Droid10

dp ↔ px converter

One formula: px = dp × (dpi ÷ 160). Enter your device's density and convert in either direction. Non-standard densities like 440 dpi are handled exactly, unlike tools that only offer the six standard buckets.

Density

Scale factor: 2.750×

1 dp = 2.750 px. Find your value with adb shell wm density.

dp → px

44.00 px

px → dp

—

sp → px

—

Assumes the user's font scale is 1.0. A user with larger system text will get more pixels at the same sp, which is the whole point of sp.

Why the density matters more than the resolution

A dp is defined as 1/160 of an inch, so the conversion to physical pixels depends only on the density the system reports. A 48 dp touch target on a 320 dpi screen is 96 px; on a 480 dpi screen it is 144 px; but in both cases it is about 7.6 mm on the glass. That physical consistency is the entire reason dp exists.

sp works the same way as dp, with one addition: it also scales with the user's font-size preference. The converter here assumes a font scale of 1.0. If a user has enlarged system text to 1.3×, a 16 sp label renders at 16 × 1.3 × scale pixels, which is why text written in sp can overflow a container that was measured in px.

To find your device's density, run adb shell wm density. If the reported value is not one of 120/160/240/320/480/640, that is normal — phones like the Pixel 3 report 440 dpi, and the system still resolves resources to the nearest bucket while using the exact value for pixel conversion.