Skip to Content
Platform.Ontology

Color depth, pixel depth and pixel ratio

Reads bits per pixel and the device pixel ratio (zoom or Retina factor).

Gets silentlyScreen and windowsScreenWeb browsersWhen the page loadsWhile you use it

In one line

Can see your screen's color depth and how sharp or zoomed it is

Reads bits per pixel and the device pixel ratio (zoom or Retina factor).

Pixel ratio shows Retina screens and browser zoom. Together with resolution it identifies display class.

What it can and can't do

What the user does: Nothing. It happens when the page loads or you zoom.

It can

  • Check the color depth number
  • Check how many real pixels sit behind each page pixel (Retina or zoom)
  • Notice when you zoom or drag the window to another screen
  • Pick sharper images to match

It cannot

  • Tell your screen model
  • Tell zoom apart from a high density screen, since the two blend into one number
  • See anything beyond these two numbers

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported12008-12-11None
EdgeSupported122015-07-29None
FirefoxSupported182013-01-08None
SafariSupported32007-10-26None
Safari on iPhoneSupported22008-07-11None
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

APIscreen.colorDepth, screen.pixelDepth, window.devicePixelRatio
Browser compat keysapi.Window.devicePixelRatio
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Script reads the value
  2. Value joins the fingerprint payload

Data you get

What comes back: Color depth, pixel depth and pixel ratio
Shape: object
How often: changes with zoom

FieldTypeUnitRangePrecision
colorDepthintegerbits24 or 301
pixelRatiofloatNone1 to 40.01

Technical limits

  • No monitor model

The story

What it is

Reads how many color bits the screen has and how sharp or zoomed the display is.

For you

You never see the reading. It is why a site shows crisp logos on a Retina laptop and a lighter picture on an old monitor.

For makers

Sites use it to send images of the right size and save data. Trackers like it because ratio plus depth plus zoom make a more unusual combination than either alone.

Where you see it

TypeExampleApps
shoppingA fashion store sends sharper photos to a phone with a ratio of 3 and plain ones to a cheap screen.None named
gamesA browser game draws its canvas at full sharp resolution on a Retina screen, or at half to keep a smooth frame rate on a weak laptop.None named
creativeA design tool like Figma keeps lines crisp when you zoom by matching its drawing to the screen ratio.Figma
adsA tracking script combines the ratio with screen size and fonts to build a device ID without cookies.None named
analyticsA site team sees that 40 percent of mobile visitors have a ratio of 3 and tests for that first.None named
mapsA web map loads sharper tiles on dense screens so street names stay readable.Google Maps

Risks

  • Adds to a fingerprint
  • Reveals zoom level

What the platform says

Good uses and abuse

Legitimate uses

  • Serve right images

Known abuse

  • Fingerprint input

Scores

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits3Rough identifying entropy, when known

A real example: LinkedIn

Collector key(s): colorDepth, pixelDepth, pixelRatio.

Sources

How well checked: Based on official documentation.

On this page