Skip to content
On this page

Screen resolution fingerprinting reads the display measurements a browser reports - screen.width/height, availWidth/availHeight, colorDepth, devicePixelRatio, and the inner/outer window sizes. It is a way to identify a device by its display. On their own these values are only moderately identifying (lots of people share common resolutions, but the available-area and pixel-ratio mix adds entropy - extra detail that narrows down who you are). What matters more is that they must fit together: the window cannot be larger than the screen, the available area must be the screen minus realistic OS bars like a taskbar, and the device pixel ratio (physical pixels per CSS pixel) must match the device being claimed. Headless browsers (browsers driven by code, with no visible window) report default sizes and impossible combinations that give them away.

Quick facts

Readsscreen.width/height, availWidth/availHeight, colorDepth, devicePixelRatio
WindowinnerWidth/Height, outerWidth/Height, screenX/Y
Coherence ruleswindow <= screen; avail = screen - OS chrome; dpr matches device
Headless tell800x600, 0x0, or inner == outer (no browser chrome)
Retina rulemacOS/iPhone report devicePixelRatio >= 2

The display geometry surface

A browser exposes two related sets of measurements. First the screen itself: screen.width/height (the full display), availWidth/availHeight (the display minus the taskbar, dock, or menu bar), colorDepth (bits of color per pixel, almost always 24), and devicePixelRatio (physical pixels per CSS pixel - 1 on a standard screen, 2 on Retina, 1.25 or 1.5 on scaled Windows). Then the window: innerWidth/innerHeight (the viewport, meaning the visible page area), outerWidth/outerHeight (including the browser's own toolbars, known as chrome), and screenX/screenY (where the window sits on the screen). Common resolutions (1920x1080, 1440x900, 390x844) are shared by many users, so resolution alone is low-entropy. But the full set together - resolution plus available area plus pixel ratio plus window size - is meaningfully identifying and, just as important, it is structured: the values have to make sense relative to each other.

Coherence rules and headless defaults

That structure is what catches bots, because the values cannot be set independently:

  • Window within screen - outerWidth/Height cannot exceed screen.availWidth/Height. A window bigger than the screen is impossible on real hardware.
  • Available area - availHeight should be screen.height minus a plausible taskbar/dock; if the two are equal (avail == full) it implies no OS bars at all, which is common in headless.
  • Chrome height - outerHeight - innerHeight is the height of the browser's toolbars; zero means no chrome (headless), and the same fixed, unrealistic value across many machines is a tell.
  • Pixel ratio coherence - an iPhone or Retina Mac User-Agent paired with devicePixelRatio: 1 is a contradiction, because those devices are always >= 2.

Headless browsers ship with telltale default geometry - 800x600, 1280x720 with inner == outer, or 0x0 - and because those defaults are reused across an entire scraping fleet, they stand out against the natural spread of real displays.

Setting believable display metrics

The fix is to present one complete, internally consistent display profile that matches the device you claim to be: a common real resolution, an available area reduced by a realistic amount of OS chrome, a window smaller than the screen with a non-zero toolbar height, and a device pixel ratio that fits the platform. For a desktop, 1920x1080 with availHeight around 1040, dpr 1, and a windowed viewport is safe; for a specific phone, copy that model's exact metrics and pixel ratio.

As with the rest of the fingerprint, the display values must also agree with the User-Agent, Client Hints, hardware signals, and media queries (orientation, pointer type). The display is just one facet of a single coherent device identity - editing screen.width on its own, while leaving the window sizes and pixel ratio at their headless defaults, creates exactly the contradictions anti-bot systems look for.

The CSS engine as an independent witness

Display geometry is unusual among fingerprinting surfaces because the browser exposes it through two entirely separate subsystems. The screen object and the window dimensions are read by JavaScript; the same physical facts are also readable through CSS media queries, evaluated by the layout engine. Those are different code paths reaching the same underlying values, which makes display geometry one of the easiest places to run a cross-API coherence check.

The core probe is a single line: matchMedia('(device-width: ' + screen.width + 'px)') must match. If screen.width was changed by assigning to the object, CSS still reports the real display and the query fails. The same pairing works for devicePixelRatio against (resolution: Xdppx), and for screen.colorDepth against the color media feature, which expresses the same fact in bits per channel rather than bits per pixel - so the two must convert into one another.

A second family of checks reads the relationships between values rather than the values themselves. availWidth and availHeight describe the screen minus the operating system chrome, so on a desktop they are normally slightly smaller than the full dimensions - a taskbar or menu bar occupies real pixels. Values that match exactly suggest no desktop environment at all. Similarly the outer window must fit inside the screen, screen.orientation must agree with which dimension is larger, and visualViewport must reconcile with innerWidth and innerHeight.

Form-factor coherence: the display is not the only witness

Screen dimensions imply a class of device, and that implication is testable against inputs that have nothing to do with the display.

  • Pointer and hover - the pointer: fine and hover: hover media features describe a mouse. A desktop-sized viewport reporting a coarse pointer with no hover capability, or a mobile User-Agent reporting a fine pointer, is describing two different devices.
  • Touch stack - navigator.maxTouchPoints must agree with the pointer media features, and a mobile User-Agent should expose a working touch event stack rather than merely reporting a nonzero touch point count.
  • Plausibility bounds - real displays fall in a bounded range. Dimensions of a few dozen pixels, or tens of thousands, describe no shipping hardware.
  • Native accessors - the screen properties should resolve through prototype getters, not own data properties on the instance, exactly as covered in native function integrity checking.
  • Event coordinates - a pointer event carries both viewport-relative and screen-relative coordinates, and the offset between them must be consistent with the reported window position and size.

Because these constraints reference each other, editing one value has a wide blast radius: a change to screen.width that is not reflected in CSS, in the available dimensions, in the window bounds, in the orientation, and in the event coordinate offsets creates several contradictions rather than one altered value. This is the general shape of the problem - display geometry is a system of related facts, and it is coherent only when set at the level where all of them derive from the same source, which is the window manager and the browser engine rather than page JavaScript.

Code example

javascript
// Display tuple an anti-bot script reads
const display = {
  screen: [screen.width, screen.height].join('x'),
  avail:  [screen.availWidth, screen.availHeight].join('x'),
  depth:  screen.colorDepth,                  // ~24
  dpr:    window.devicePixelRatio,            // 1 / 2 / 1.5
  inner:  [innerWidth, innerHeight].join('x'),
  outer:  [outerWidth, outerHeight].join('x')
};

// Coherence checks (pseudo):
//   outerWidth > screen.availWidth            -> window bigger than screen (impossible)
//   outerHeight - innerHeight === 0           -> no browser chrome (headless)
//   /iPhone|Macintosh/.test(ua) && dpr < 2    -> Retina device with dpr 1 (contradiction)
//   screen === '800x600' || screen === '0x0'  -> headless default

Next in Environment and display signals · 2 of 7

The same geometry read through a different subsystem.

What Is CSS Media Query Fingerprinting?

Related terms

Concept map

Concept map

How Screen Resolution Fingerprinting connects

The terms most directly tied to this one. Hover a node to see its neighbours, click to preview, drag to rearrange.

0 terms · 0 connections
You are here · Anti-Bot
Building map…

Frequently asked questions

Is screen resolution a strong fingerprint on its own?

Only moderately. Common resolutions are shared by many users, so resolution by itself is low-entropy, but the full set (resolution, available area, pixel ratio, window sizes) is more identifying. Its bigger value is coherence: the window cannot exceed the screen, the pixel ratio must match the device, and headless defaults get reused across whole fleets - so the combination, not the resolution alone, is what flags a bot.

What gives away a headless browser in the screen metrics?

Telltale default sizes (800x600, 1280x720, 0x0), inner dimensions equal to outer (meaning no browser toolbar height), available area equal to the full screen (no taskbar or dock), and these same values repeated across an entire fleet. A window larger than the screen, or a Retina-class User-Agent reporting devicePixelRatio 1, is also a direct contradiction.

How should I set window and screen sizes for a scraper?

Use one complete, coherent profile for the device you claim to be: a common real resolution, an available area reduced by a realistic amount of OS chrome, a windowed viewport smaller than the screen with a non-zero toolbar height, and a matching device pixel ratio. Keep it consistent with the User-Agent, Client Hints, and media-query signals - do not edit one value in isolation.

Why does availHeight matching screen.height look suspicious on a desktop?

Because desktop operating systems reserve screen space for a taskbar, dock, or menu bar, so the available area is normally slightly smaller than the full display. When the two are exactly equal on a session claiming a desktop platform, it usually means there is no desktop environment present - a common characteristic of a virtual display in a headless container.

Last updated: 2026-07-30 · Facts last verified: 2026-07-30