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.
Design dp values to physical pixels
Physical pixels to Android dp
dp → px by density bucket
Common dp values converted to pixels at each density bucket.
| dp | ldpi (0.75x) | mdpi (1x) | hdpi (1.5x) | xhdpi (2x) | xxhdpi (3x) | xxxhdpi (4x) |
|---|---|---|---|---|---|---|
| 4dp | 3px | 4px | 6px | 8px | 12px | 16px |
| 8dp | 6px | 8px | 12px | 16px | 24px | 32px |
| 12dp | 9px | 12px | 18px | 24px | 36px | 48px |
| 16dp | 12px | 16px | 24px | 32px | 48px | 64px |
| 20dp | 15px | 20px | 30px | 40px | 60px | 80px |
| 24dp | 18px | 24px | 36px | 48px | 72px | 96px |
| 32dp | 24px | 32px | 48px | 64px | 96px | 128px |
| 36dp | 27px | 36px | 54px | 72px | 108px | 144px |
| 40dp | 30px | 40px | 60px | 80px | 120px | 160px |
| 48dp | 36px | 48px | 72px | 96px | 144px | 192px |
| 56dp | 42px | 56px | 84px | 112px | 168px | 224px |
| 64dp | 48px | 64px | 96px | 128px | 192px | 256px |
| 72dp | 54px | 72px | 108px | 144px | 216px | 288px |
| 80dp | 60px | 80px | 120px | 160px | 240px | 320px |
| 96dp | 72px | 96px | 144px | 192px | 288px | 384px |
| 108dp | 81px | 108px | 162px | 216px | 324px | 432px |
| 120dp | 90px | 120px | 180px | 240px | 360px | 480px |
Density bucket reference
Android groups screen densities into six buckets, with mdpi (160dpi) as the 1x baseline.
| Bucket | dpi | Scale | 16dp → px | 48dp → px | Typical use |
|---|---|---|---|---|---|
| ldpi | 120 | 0.75x | 12px | 36px | Old, low-end devices |
| mdpi | 160 | 1x | 16px | 48px | Baseline, emulators |
| hdpi | 240 | 1.5x | 24px | 72px | Small devices, wearables |
| xhdpi | 320 | 2x | 32px | 96px | Mid-range phones |
| xxhdpi | 480 | 3x | 48px | 144px | Flagship phones |
| xxxhdpi | 640 | 4x | 64px | 192px | Ultra-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.