MobileCheck

What is device pixel ratio (DPR)?

Glossary · Updated October 23, 2026 · Also called: pixel ratio, pixel density, Retina scale

Definition Device pixel ratio (DPR) is the number of physical screen pixels used to draw one CSS pixel in each direction. A DPR of 3 means each CSS pixel is 3×3 device pixels. Current iPhones have a DPR of 3 (older and XR-class models 2), Android phones commonly 2.625–4, and current iPads 2. JavaScript reads it as window.devicePixelRatio.

How does device pixel ratio work?

Screen resolution divided by DPR gives the viewport size in CSS pixels. An iPhone 16 Pro Max screen is 1320 physical pixels wide; at a DPR of 3 that is a 440 px viewport. A Pixel 7 is 1080 pixels wide with a DPR of 2.625, which gives 412 CSS px (rounded). Higher DPR makes text and images sharper, but it does not give the page more room: the layout only sees the CSS width.

The ratio is not always a whole number. Android devices report values such as 2.625 or 2.75, and desktop browsers change the DPR when you zoom: at 150% browser zoom on a 1× monitor, devicePixelRatio is 1.5.

Where it matters

Example

Serve a 2× and 3× version of a fixed-size logo:

<img src="logo-160.png"
     srcset="logo-160.png 1x, logo-320.png 2x, logo-480.png 3x"
     width="160" height="40" alt="Acme">

In CSS, the resolution media feature targets dense screens: @media (min-resolution: 2dppx) { … }. Safari supports the standard syntax since version 16; older Safari needed -webkit-min-device-pixel-ratio.

On iPhone vs Android

Apple uses a few fixed values: 2 for the iPhone SE, XR and 11 and current iPads, 3 for other recent iPhones. Android manufacturers choose from many density buckets, so DPR varies even between phones of the same size; the mobile viewport sizes table lists the exact value per model. MobileCheck emulates each device with its real pixel ratio, which is why the screenshots in a report are sharp at their real resolution.

Guides and tools

Sources

  1. MDN: Window.devicePixelRatio
  2. MDN: Responsive images

All 27 glossary terms, A to Z