Pixel Density Converter
This converter turns Android's density-independent pixels (dp) into real pixels for each screen density, from mdpi to xxxhdpi. Android sizes everything in dp, so a layout looks the same size on every screen, and each image has to be supplied in several pixel sizes, one per density bucket.
The rule is simple: px = dp * dpi / 160. One dp is one pixel on a 160 dpi screen, the mdpi baseline.
Pixel sizes by density
| Density | Scale | 24 dp | 48 dp | 96 dp |
|---|---|---|---|---|
| mdpi (160 dpi) | 1x | 24 px | 48 px | 96 px |
| hdpi (240 dpi) | 1.5x | 36 px | 72 px | 144 px |
| xhdpi (320 dpi) | 2x | 48 px | 96 px | 192 px |
| xxhdpi (480 dpi) | 3x | 72 px | 144 px | 288 px |
| xxxhdpi (640 dpi) | 4x | 96 px | 192 px | 384 px |
For example, a 48 dp launcher icon needs to be 144 px for xxhdpi screens. To go from pixels back to dp, divide by the scale: 300 px on an xxhdpi screen is 300 / 3 = 100 dp.
Density units
-
Dp (Density-independent pixels): Dp, also known as dp (density-independent pixels), is a unit commonly used in Android development. It represents a virtual pixel unit that is independent of the device's actual pixel density. Dp ensures consistent layout and design across various screens, regardless of their physical size or pixel density.
Conversion factor: 1 dp = 1 physical pixel on a 160 dpi (dots per inch) screen. -
Mdpi (Medium Dots per Inch): Mdpi, or medium dots per inch, is a pixel density unit used in Android development. It represents a baseline density of 160 dpi (dots per inch). It is often used as a reference point to calculate pixel densities for other devices.
Conversion factor: 1 mdpi = 1 physical pixel on a 160 dpi screen -
Hdpi (High Dots per Inch): Hdpi, or high dots per inch, is a pixel density unit used in Android development. It represents a density of 240 dpi. Devices with hdpi pixel density offer higher resolution and sharper visuals compared to mdpi.
Conversion factor: 1 hdpi = 1 physical pixel on a 240 dpi screen.
Image resolution: 240 / 160 = 1.5 px.
Your image should have a resolution of 1.5x the baseline. -
Xhdpi (Extra-high Dots per Inch): Xhdpi, or extra-high dots per inch, is a pixel density unit used in Android development. It represents a density of 320 dpi. Devices with xhdpi pixel density provide even greater detail and clarity than hdpi.
Conversion factor: 1 xhdpi = 1 physical pixel on a 320 dpi screen.
Image resolution: 320 / 160 = 2 px.
Your image should have a resolution of 2x the baseline. -
Xxhdpi (Extra-extra-high Dots per Inch): Xxhdpi, or extra-extra-high dots per inch, is a pixel density unit used in Android development. It represents a density of 480 dpi. Devices with xxhdpi pixel density offer exceptional visual quality and sharpness.
Conversion factor: 1 xxhdpi = 1 physical pixel on a 480 dpi screen.
Image resolution: 480 / 160 = 3 px.
Your image should have a resolution of 3x the baseline. -
Xxxhdpi (Extra-extra-extra-high Dots per Inch): Xxxhdpi, or extra-extra-extra-high dots per inch, is a pixel density unit used in Android development. It represents a density of 640 dpi. Devices with xxxhdpi pixel density provide the highest level of visual fidelity and detail.
Conversion factor: 1 xxxhdpi = 1 physical pixel on a 640 dpi screen.
Image resolution: 640 / 160 = 4 px.
Your image should have a resolution of 4x the baseline.
Frequently asked questions
What is the difference between dp and sp?
Both are density-independent, but sp, scale-independent pixels, also follow the text size the user picks in the system settings. Android uses sp for text and dp for everything else.
Is this the same as dpi or ppi?
No. Dpi and ppi measure a screen's or print's pixels per inch; this converter uses them only to pick the Android density bucket. For dpi and dots per millimeter, see the Image Resolution Converter.