InfyCalculator
💻

DP to PX Converter

Convert Android density-independent pixels (dp) to physical pixels (px) and back for every density bucket — mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi — with the same size in iOS points.

Value
Convert
Screen density
Loading calculator…

How it works

px = dp × (dpi ÷ 160) · dp = px ÷ (dpi ÷ 160) · scale: ldpi 0.75, mdpi 1, hdpi 1.5, xhdpi 2, xxhdpi 3, xxxhdpi 4

Android lays out screens in density-independent pixels: 1 dp is one physical pixel on a 160 dpi (mdpi) screen, so a 48 dp button is about 7.6 mm wide on any phone. The system scales dp to real pixels by dpi ÷ 160, and designers export bitmap assets for each density bucket. iOS uses the same idea with points (@1x, @2x, @3x), so 1 dp ≈ 1 pt. Text uses sp, which equals dp at the default font scale.

Worked example

A 48 dp touch target on an xxhdpi phone (≈ 480 dpi): scale = 480 ÷ 160 = 3, so 48 × 3 = 144 px. On mdpi it is 48 px, on xhdpi 96 px and on xxxhdpi 192 px; physically about 7.62 mm everywhere.

Sources: Android Developers — Support different pixel densities · Material Design — Layout, density and touch targets

Frequently asked questions

How do I convert dp to px?

Multiply by the screen density divided by 160: px = dp × dpi / 160. On an xxhdpi (480 dpi) phone, 1 dp = 3 px.

How many pixels is 48 dp?

48 px on mdpi, 72 px on hdpi, 96 px on xhdpi, 144 px on xxhdpi and 192 px on xxxhdpi. 48 dp is Android’s minimum recommended touch-target size.

What is the difference between dp and sp?

sp (scale-independent pixels) are dp that also follow the user’s font-size setting. Use sp for text and dp for everything else.

Is dp the same as an iOS point?

Practically yes: both are about 1/160 inch on a typical screen. An iPhone @3x screen maps 1 pt to 3 px, like xxhdpi.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.