Android Screen Density Converter (dp, sp, px)

Type a size in dp, sp or px, pick a device density and see pixels for every bucket, icon export sizes, window size class and grid column widths.

ブラウザ内で動作します。ファイルは端末の外に出ません。 確認方法を見る

…

使い方

  1. 1
    Pick a density

    Choose a device preset, tap a bucket button or type the dpi of your screen.

  2. 2
    Enter a size

    Type a value and choose dp, sp or px; set the font scale for text.

  3. 3
    Read the bucket table

    See the pixel size in every density and copy the dimens or Compose snippet.

  4. 4
    Open Icon sizes

    Check launcher, adaptive and notification icon exports and download the CSV.

  5. 5
    Open Screen and layout

    Enter width and height in px to get the dp window and size class.

  6. 6
    Plan the grid

    Set columns, margin and gutter to get the column width in dp and px.

このツールについて

Android screens range from cheap 720p phones to 1440p flagships and tablets, so a layout measured in raw pixels looks tiny on one device and huge on another. Android solves this with density-independent pixels: one dp is one physical pixel on a 160 dpi screen, and the system multiplies by the device density everywhere else. Text uses scalable pixels, which follow the same rule and are then multiplied again by the font size the user picked in Settings. Designers deliver bitmaps for density buckets named ldpi, mdpi, hdpi, xhdpi, xxhdpi and xxxhdpi, and developers need to know which bucket a real device falls into. This converter does all of that arithmetic in one place: it converts a value between dp, sp and px for any dpi, lists the result in every bucket, shows the export size for launcher, adaptive and notification icons, and turns a screen resolution into a dp window with its Material 3 window size class and a column grid.

The formula

px = dp x (dpi / 160). For text, px = sp x font scale x (dpi / 160). A 48 dp touch target on a 420 dpi phone is 48 x 2.625 = 126 px. The tool shows the value in every bucket so you can see what an asset needs at each density, and a bar that places the size on a 400 dp phone width.

Which bucket a device uses

Real devices rarely sit exactly on 160, 240, 320, 480 or 640 dpi. A phone reporting 420 dpi loads drawables from the nearest bucket, xxhdpi, and the system scales them down slightly. The converter names the bucket for the dpi you enter and lets you switch between common presets or type your own value.

Icon sizes

Launcher icons are 48 dp, so 48, 72, 96, 144 and 192 px from mdpi to xxxhdpi. Adaptive icon layers are 108 dp with the inner 72 dp visible after masking and a 66 dp safe zone for the logo. Status bar notification icons are 24 dp, white on transparent. The table can be downloaded as CSV for a design hand-off, and it also lists the 512 px Play Store icon and the 1024 x 500 feature graphic.

Screen and layout

Enter a resolution and the tool converts it to a dp window, names the smallest-width qualifier (such as sw411dp) and the window size class for portrait and landscape: compact below 600 dp, medium to 839, expanded to 1199, then large and extra-large. The grid calculator divides the width into columns after margins and gutters, which is how Material layouts are specified.

Limits

Presets are typical configurations, not a database of exact devices; use adb shell wm density and wm size to read a real phone. Status and navigation bars, display cutouts and the user's display size setting change the usable window, and this tool does not model them. It also does not resize images; export assets from your design tool at the sizes shown.

計算例

A designer hands over a 24 dp share icon and asks for PNG exports. With 24 dp entered the bucket table shows 18 px for ldpi, 24 for mdpi, 36 for hdpi, 48 for xhdpi, 72 for xxhdpi and 96 for xxxhdpi. The team's test phone is 1080 x 2400 at 420 dpi, which the tool reports as 411 x 914 dp, compact width in portrait and expanded in landscape, loading xxhdpi resources. On that width a 4-column grid with 16 dp margins and 8 dp gutters gives columns of 88.9 dp, which is 233 px. Body text at 16 sp with the user's font scale at 1.3 renders at 16 x 1.3 x 2.625 = 54.6 px.

ポイント

よくある質問

What is the difference between dp and sp?

Both scale with screen density. sp is also multiplied by the user's font size preference, so use sp for text and dp for everything else, including icons and spacing. If you set text in dp it will ignore accessibility settings.

Why does my 420 dpi phone use xxhdpi images?

Android picks the closest density bucket and scales from there. 420 is nearer to 480 than to 320, so it uses xxhdpi drawables and shrinks them by about 12 percent.

Do I still need PNGs for every density?

Not for most icons. Vector drawables scale to any density from one XML file. Bitmaps such as photos and complex illustrations still benefit from per-density exports or WebP at xxhdpi and xxxhdpi.

What is the minimum touch target size?

Material guidance and Android accessibility checks use 48 x 48 dp. The visible icon can be smaller, but the tappable area should reach 48 dp.

How do window size classes help?

They group screens by available width so you can switch layouts, for example a bottom bar on compact, a navigation rail on medium and a permanent drawer on expanded. They are based on the app window, not the physical device.

Is anything sent to a server?

No. All maths runs in your browser and your last values are saved locally so a reload keeps them. Undo and redo cover every change.

完全無料料金なし、登録なし
ファイルはプライベートすべてブラウザ内で動作します
あなたの言語で使いやすく多くの言語に対応