dp · sp ↔ px

DP·SP to PX Converter

Turn dp values from Android mockups into physical pixels at the density bucket you pick. Click a result to copy it.

Density bucket

Design dp values to physical pixels

dp

Physical pixels to Android dp

px

dp → px by density bucket

Common dp values converted to pixels at each density bucket.

dpldpi (0.75x)mdpi (1x)hdpi (1.5x)xhdpi (2x)xxhdpi (3x)xxxhdpi (4x)
4dp3px4px6px8px12px16px
8dp6px8px12px16px24px32px
12dp9px12px18px24px36px48px
16dp12px16px24px32px48px64px
20dp15px20px30px40px60px80px
24dp18px24px36px48px72px96px
32dp24px32px48px64px96px128px
36dp27px36px54px72px108px144px
40dp30px40px60px80px120px160px
48dp36px48px72px96px144px192px
56dp42px56px84px112px168px224px
64dp48px64px96px128px192px256px
72dp54px72px108px144px216px288px
80dp60px80px120px160px240px320px
96dp72px96px144px192px288px384px
108dp81px108px162px216px324px432px
120dp90px120px180px240px360px480px

Density bucket reference

Android groups screen densities into six buckets, with mdpi (160dpi) as the 1x baseline.

BucketdpiScale16dp → px48dp → pxTypical use
ldpi1200.75x12px36pxOld, low-end devices
mdpi1601x16px48pxBaseline, emulators
hdpi2401.5x24px72pxSmall devices, wearables
xhdpi3202x32px96pxMid-range phones
xxhdpi4803x48px144pxFlagship phones
xxxhdpi6404x64px192pxUltra-high-res (new flagships)

dp to px formula

dp (density-independent pixel) keeps an element the same physical size on every screen. On an mdpi (160dpi) screen 1dp = 1px; denser screens need more physical pixels for the same dp.

px = dp × dpi ÷ 160 = dp × scale, and dp = px ÷ scale. Android places image assets at scaled sizes: 1.5× for hdpi, 2× for xhdpi and so on, all based on the mdpi original.

px = dp × (dpi ÷ 160)
dp = px ÷ (dpi ÷ 160)
Example: 48dp @ xxhdpi (480dpi) = 48 × 3 = 144px

Example: the recommended minimum touch target is 48dp. On an xxhdpi device (480dpi, 3×) that is 48 × 3 = 144px; on xhdpi (320dpi, 2×) it is 96px.

sp vs dp

sp (scalable pixel) starts at the same size as dp but grows when the user increases the system font size. Use sp for text and dp for icons, spacing and strokes. The numbers convert exactly like dp, so this tool treats them the same.

CSS px on the web is the same idea as Android dp: both are density-corrected logical pixels. You can copy dp values straight into CSS px; for responsive web layouts you would then convert to vw or rem as usual.

Things to know in practice

  • Values in Figma's Android frames are almost always dp. A 360dp-wide frame matches a 360px-wide web viewport.
  • iOS points and Android dp are both density-corrected units, so 1pt ≈ 1dp — but iOS pt here is a screen unit, not the print point (1/72 inch). For print pt ↔ px use the PT to PX converter.
  • Convert to px only when you need physical pixels (screenshots, image assets). Keep layout values in dp, which is the Android standard.

Frequently asked questions

How many pixels is 48dp?

It depends on density: 48px on mdpi (160dpi), 72px on hdpi (240dpi), 96px on xhdpi (320dpi), 144px on xxhdpi (480dpi) and 192px on xxxhdpi (640dpi).

What is the difference between dp and px?

px counts physical pixels; dp is a density-corrected logical unit. The same 48dp is 48px on a low-density screen but 144px on a high-density one.

Should I use sp or dp?

Use sp for text and dp for everything else (icons, spacing, strokes). sp follows the user's font size setting for accessibility; dp stays constant.

Can I use Android dp values as CSS px?

Yes — copy the number as-is. CSS px is also a density-corrected logical pixel, just like dp. On the web you would then convert to vw or rem for responsiveness.

What is the dpi of xxhdpi?

480dpi, a 3× scale from the mdpi (160dpi) baseline, so px = dp × 3. Flagship phones such as recent Pixel and Galaxy S models commonly use xxhdpi screens.

Related tools