Docelora
ToolsAboutContact
Huawei developer tools

HarmonyOS VP to PX Converter

Convert between the ArkUI units used in HarmonyOS apps: virtual pixels (vp), font pixels (fp), physical pixels (px) and logical pixels (lpx) relative to a design width.

Quick answer: enter a value and unit, the screen DPI (e.g. 480) and font scale. 1 vp equals DPI ÷ 160 px, so on a 480 dpi screen 16 vp = 48 px. Use vp for layout and fp for text.

HarmonyOS VP to PX Converter

vp · fp · px · lpx

Runs on your device: everything you type or open is processed in this browser tab. Nothing is uploaded to Docelora or anyone else.

ArkUI units

UnitMeaning
pxPhysical screen pixel
vpVirtual pixel – density-independent, like Android dp (px = vp × DPI ÷ 160)
fpFont pixel – like vp but also scaled by the user’s font size
lpxLogical pixel relative to a design width (px × design width ÷ screen width)

ArkUI uses vp by default for sizes when no unit is given. These formulas follow HarmonyOS’s pixel unit documentation; actual devices report their own density.

Related tools

Frequently asked questions

What is vp in HarmonyOS?

A virtual pixel that keeps sizes consistent across screen densities.

How do I convert vp to px?

px = vp × DPI ÷ 160.

What is fp?

A font pixel that also follows the user’s font-size setting.

What is lpx?

A unit relative to a design width you set, useful for pixel-perfect designs.

Is vp the same as Android dp?

The concept and formula are the same.

What is the default unit in ArkUI?

vp, when a number is given without a unit.

Which DPI should I use?

Your target device’s density; many phones are around 440–560 dpi.

Should text use fp?

Yes, so it respects accessibility font settings.

Can I convert px back to vp?

Yes – choose px as the unit.

What is a typical design width?

720 lpx is common in HarmonyOS design guides.

Does font scale affect vp?

No – only fp.

Is this official?

It applies the documented formulas; always test on devices.

What about iOS points?

Use the iOS Points to Pixels converter.

Is it free?

Yes.

Does it need an internet connection?

Only to load the page.

Does it work on a phone?

Yes – the table scrolls sideways on small screens.

Is anything sent to a server?

No – the calculation runs in your browser.

Can I copy the results?

Yes – use the Copy button under the results.

How are values rounded?

To two decimal places.

When was the information checked?

The reference data on this page was reviewed on 8 November 2026.

Last reviewed: 8 November 2026.