Android DP/PX converter

Calculate pixels (and other units!) in DPs

This tool helps you convert pixels to and from DPs (density independent pixels).

  1. Enter a value and unit to calculate the dimensions for the various DPI bins (ldpi, mdpi, hdpi, xhdpi, xxhdpi and xxxhdpi).
  2. Enter either a DP (density independent pixel) value or a PX (pixel) value below.
    If you use pixels, you can set the screen density that it currently displays on.

compensating for user's font size at
Please enter a value.

Icon presets:

The values are calculated based on:

The primary DPI bins in Android: ldpi, mdpi, hdpi, xhdpi, xxhdpi and xxxhdpi (tvdpi not illustrated).

ldpi 120 dpi
mdpi 160 dpi
tvdpi 213 dpi
hdpi 240 dpi
xhdpi 320 dpi
xxhdpi 480 dpi
xxxhdpi 640 dpi

Take special note of the `nodpi` bin; specifying resources using this qualifier specifically instructs the system to not scale resources, regardless of the current screen’s density. The DP/PX converter above behaves slightly different when selecting this bin, as it treats the specified pixel dimension as DP.


More reading:
Android Developer Guide on Supporting Multiple Screens on DPI categories
Adapted from Android DP / PX converter by Skinkers


Check out Pixplicity Academy. Every few months, we give a two-day workshop on Android. With lunch and dinner included, it gives you the toolkit to form a solid basis for Android development at any level. Our world-class Android guru and CTO at Pixplicity, Paul Lammertsma, teaches the workshop of only 10 people, so you will get a ton of personal attention.

We’re happy to help you arrange a trip to the Netherlands; check the Academy page for up-to-date information about upcoming workshops.

Pixplicity Academy

I'm an engineer

Sign up for a two-day Pixplicity Academy course.

We offer workshops for any level Android developer in a lovely hotel in the Netherlands, with lunch and dinner included.

Latest Videos & Posts