ArkUI units
| Unit | Meaning |
|---|---|
| px | Physical screen pixel |
| vp | Virtual pixel – density-independent, like Android dp (px = vp × DPI ÷ 160) |
| fp | Font pixel – like vp but also scaled by the user’s font size |
| lpx | Logical 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.