dp sp pt px Converter
Convert between dp, sp, pt, px, and rem for Android and iOS development. See pixel values across all screen densities at once — mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi.
How Does the dp sp pt px Converter Work?
The dp sp pt px Converter is a free online tool designed for mobile developers who need to translate between density-independent units used by Android, iOS, and web platforms. Mobile screens come in a wide range of physical sizes and pixel densities. Without a density-independent unit system, a 16-pixel icon would appear large on a low-density screen and tiny on a high-density screen. Android solves this with dp (density-independent pixels) and sp (scale-independent pixels for text), while iOS uses pt (points). This converter lets you enter a value in any of these units and instantly see the equivalent pixel values across every standard screen density.
Understanding Screen Density Units
px = dp x (dpi / 160)
dp = px / (dpi / 160)
sp = dp (same conversion, scaled for text)
pt (iOS) = dp (1 point = 1 density-independent pixel)
1 rem = 16px (web default)
Android defines a baseline density of 160 dpi, called mdpi. At mdpi, 1 dp equals exactly 1 physical pixel. As screen density increases, more physical pixels are packed into the same area. At hdpi (240 dpi), the multiplier is 1.5x, so 1 dp becomes 1.5 pixels. At xhdpi (320 dpi) it is 2x, at xxhdpi (480 dpi) it is 3x, and at xxxhdpi (640 dpi) it is 4x. This means a 24dp icon requires a 24px asset for mdpi, a 36px asset for hdpi, a 48px asset for xhdpi, a 72px asset for xxhdpi, and a 96px asset for xxxhdpi.
Android Resource Directories
Android uses density-specific resource folders to serve the correct asset size to each device. When you place image assets in drawable-mdpi, drawable-hdpi, drawable-xhdpi, drawable-xxhdpi, and drawable-xxxhdpi, the system automatically selects the right folder based on the device screen density. This converter shows you exactly which pixel dimensions your assets need for each folder.
iOS Points and Scale Factors
iOS uses a similar concept called points. Non-Retina devices display at 1x (1 point = 1 pixel), Retina devices at 2x, and Super Retina devices at 3x. When preparing image assets for iOS, you provide @1x, @2x, and @3x versions. A 24pt icon needs a 24px @1x image, a 48px @2x image, and a 72px @3x image. The point system in iOS is functionally equivalent to Android dp — both represent a density-independent measurement that maps to different pixel counts on different hardware.
Common Reference Sizes
Android Material Design defines several standard sizes that developers frequently convert: the app toolbar height is 56dp, standard icons are 24dp, the floating action button (FAB) is 56dp, and the minimum touch target is 48dp. Knowing the pixel equivalents of these sizes across densities helps when creating custom assets, debugging layout issues, or communicating specifications with designers.
Frequently Asked Questions
What is the difference between dp and px?
dp (density-independent pixel) is a virtual unit that Android uses to ensure consistent sizing across screens of different densities. 1 dp equals 1 physical pixel at mdpi (160 dpi). On higher density screens, 1 dp maps to more physical pixels — for example, 2 pixels at xhdpi (320 dpi) and 3 pixels at xxhdpi (480 dpi). Using dp instead of px means your layouts look the same physical size on all devices.
What is the difference between dp and sp?
dp and sp use the same density-based conversion, but sp (scale-independent pixel) also respects the user accessibility font size preference on Android. You should use sp for text sizes and dp for everything else (margins, padding, icon sizes). If a user sets their system font to "Large," sp-based text will scale up while dp-based dimensions remain unchanged.
How do iOS points relate to Android dp?
iOS points (pt) and Android dp are conceptually equivalent — both are density-independent units that abstract away physical pixel density. 1 pt on iOS equals 1 dp on Android in terms of intended physical size. The main difference is the scale factor naming: iOS uses @1x, @2x, @3x while Android uses mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi with multipliers of 1x, 1.5x, 2x, 3x, and 4x.
Do I need to convert dp for Flutter development?
No. Flutter uses logical pixels which are equivalent to dp on Android and points on iOS. Flutter handles the density conversion internally, so when you specify a width of 56 in Flutter, it automatically maps to the correct number of physical pixels on whatever device is running the app. You only need to convert when working with platform-specific native code or preparing bitmap assets.
What screen density do most modern phones use?
Most modern Android phones use xxhdpi (3x / 480 dpi) or xxxhdpi (4x / 640 dpi) density buckets. Modern iPhones use @3x (Super Retina). When designing for the majority of current devices, prioritize xxhdpi and xxxhdpi assets. However, you should still provide lower-density assets for budget phones and tablets, which often use hdpi or xhdpi.