Color depth, pixel depth and pixel ratio
Reads bits per pixel and the device pixel ratio (zoom or Retina factor).
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
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 1 | 2008-12-11 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 18 | 2013-01-08 | None |
| Safari | Supported | 3 | 2007-10-26 | None |
| Safari on iPhone | Supported | 2 | 2008-07-11 | None |
| Chrome on Android | Supported | 18 | 2012-06-27 | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | screen.colorDepth, screen.pixelDepth, window.devicePixelRatio |
| Browser compat keys | api.Window.devicePixelRatio |
| How access is granted | none |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Script reads the value
- 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
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
colorDepth | integer | bits | 24 or 30 | 1 |
pixelRatio | float | None | 1 to 4 | 0.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
| Type | Example | Apps |
|---|---|---|
| shopping | A fashion store sends sharper photos to a phone with a ratio of 3 and plain ones to a cheap screen. | None named |
| games | A 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 |
| creative | A design tool like Figma keeps lines crisp when you zoom by matching its drawing to the screen ratio. | Figma |
| ads | A tracking script combines the ratio with screen size and fonts to build a device ID without cookies. | None named |
| analytics | A site team sees that 40 percent of mobile visitors have a ratio of 3 and tests for that first. | None named |
| maps | A 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
- MDN: Window.devicePixelRatio. Explains the ratio of physical screen pixels to CSS pixels, which tells a page how sharp the display is.
Good uses and abuse
Legitimate uses
- Serve right images
Known abuse
- Fingerprint input
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 3 | Rough identifying entropy, when known |
A real example: LinkedIn
Collector key(s): colorDepth, pixelDepth, pixelRatio.
Related capabilities
Related
- APFC / DNA device fingerprint (abuse prevention features). Can collect about 48 device traits and send them in secret with later requests
Sources
How well checked: Based on official documentation.