Skip to content
All fingerprint checks
Screen & display

devicePixelRatio is the scale layout actually rasterises at

Pim· Clearcote Research 2 min readCheck id dpr-vs-device-pixels

The device-pixel-content-box of a 100 CSS px box measures 100 × devicePixelRatio device pixels, to within a pixel, and image selection follows the same ratio and hover state. N/A where that box is unsupported and on Brave (severity: warn).

What a detector infers

devicePixelRatio is meant to be the scale at which layout is rasterised, and several parts of the browser act on the real scale rather than reading the number. A ResizeObserver watching the device-pixel-content-box of a 100 CSS px box reports its size in actual device pixels — 100 at a scale of 1, 200 at a scale of 2. Responsive images pick a srcset candidate for the real density, and the Sec-CH-DPR client hint reports it to the server.

On an unmodified browser all of these agree with devicePixelRatio: measured on Chrome at a scale of 1 (100 device pixels) and launched with --force-device-scale-factor=2 (200 device pixels and the 2x image), and coherent on Edge. Overrides leave them behind. Playwright's deviceScaleFactor 2 reported devicePixelRatio 2 with a box of 100 device pixels; a JavaScript override of devicePixelRatio left the box at 100, the 1x image chosen and Sec-CH-DPR at 1.

The same comparison is made for hover: the source a <picture> element selects with a (hover: hover) media condition has to agree with what matchMedia reports. dpr-matchmedia compares devicePixelRatio with the resolution media query; this row compares it with what the rasteriser and the resource loader actually do.

A fractional ratio is allowed a pixel of rounding and the srcset arm is read only at whole ratios from 1 to 3; WebKit, which lacks the device-pixel box, is N/A, and so is Brave, which varies screen geometry as a privacy feature.

How to resolve it

Set the scale at launch with --force-device-scale-factor, or run on a display that has it. Emulating deviceScaleFactor through the automation client, or overriding devicePixelRatio in script, changes the number without changing the raster.

What is screen fingerprinting?

Nearby checks in Screen & display

See all 24 checks in Screen & display
Who builds this test

Clearcote is a browser built for fingerprint coherence

It is a Chromium fork, maintained by the same people who wrote this reference. It ships as a compiled browser rather than as a stealth script injected into someone else's — which is a description of how it is built, and is not an argument about how it behaves on this check.

This audit takes no position on how Clearcote scores on Screen & display checks, on this one, or anywhere else. It has no baseline corpus of other people's fingerprints to rank you against and no vendor scoreboard — nearly every check is self-referential, asking one browser the same question through two independent APIs and reporting whether both answers can be true at once. It runs identically on any browser, including ours. Run it on yours and read the result yourself.

See the other checks in Screen & display — the family dpr-vs-device-pixels belongs to.