Color depth is accessed through screen.colorDepth, which reports the number of bits used to represent the color of a single pixel:
Color depth has been part of JavaScript since the early days of the web. In the 1990s and early 2000s, displays varied widely in color capabilities, from 8-bit (256 colors) to 16-bit ("high color") to 24-bit ("true color"). Developers needed to know color depth to optimize graphics and images.
Era: Late 1980s - mid 1990s
Details: Used a color palette (256 colors from a larger set). Common on early PCs and Macs.
Web Impact: Required careful color selection and dithering techniques
Era: Mid-late 1990s
Details: 5 bits red, 6 bits green, 5 bits blue (RGB565)
Web Impact: Good enough for most content, but lacked true color accuracy
Era: Late 1990s - present
Details: 8 bits per channel (RGB888) - true color
Web Impact: Standard for modern displays; sufficient for most applications
Era: 2000s - present
Details: 8 bits per RGB channel + 8 bits for transparency
Web Impact: Enables transparency effects; most common reported value today
Today, virtually all displays support at least 24-bit color (true color), and most report 32-bit (which includes an alpha channel for transparency). Color depth is largely standardized, making it less useful for content optimization but still valuable for fingerprinting.
| Bit Depth | Total Colors | Description | Modern Usage |
|---|---|---|---|
24 bits |
16,777,216 | True color (8 bits per RGB channel) | Common on standard displays |
32 bits |
16,777,216 + alpha | True color + transparency channel | Most common value reported today |
30 bits |
1,073,741,824 | Deep color (10 bits per RGB channel) | Professional displays, rare in browsers |
16 bits |
65,536 | High color (RGB565) | Very rare; legacy systems only |
8 bits |
256 | Indexed color palette | Obsolete; not seen on modern web |
The difference between 24-bit and 32-bit is mostly semantic in modern systems. Both provide the same 16.7 million colors; 32-bit just explicitly includes the alpha (transparency) channel, which is used for compositing windows and UI elements.
In practice, color depth is rarely used for legitimate purposes today because:
The few remaining uses include:
Modern high-end displays support 10-bit color per channel (30-bit total), enabling HDR (High Dynamic Range) content. However:
screen.colorDepth rarely reports values above 24 or 32, even on 10-bit displayscolorDepth property wasn't designed for modern color technologiesAll modern browsers report screen.colorDepth consistently on the same hardware. The value depends on the operating system and display configuration, not the browser.
| Platform | Typical Value | Notes |
|---|---|---|
| Windows 10/11 | 32 bits | Almost universal on modern Windows |
| macOS | 24 bits | Even on Retina displays with higher capabilities |
| Linux | 24 or 32 bits | Depends on X11/Wayland configuration |
| iOS | 32 bits | Consistent across all modern iOS devices |
| Android | 24 or 32 bits | Varies by device and Android version |
screen.pixelDepth is essentially identical to colorDepth on modern systems. It was intended to represent bits per pixel for the frame buffer, but in practice, both properties return the same value.
Color depth provides minimal fingerprinting value on its own due to standardization (most users report 24 or 32 bits), but it contributes to overall device fingerprinting when combined with other attributes.
Because nearly all modern devices report either 24-bit or 32-bit color depth, this attribute alone provides very little identifying information—approximately 1 bit of entropy (dividing users into two roughly equal groups).
The color depth value can weakly suggest operating system:
This can help trackers detect browser fingerprint spoofing attempts.
While weak alone, color depth adds to fingerprinting when combined with:
User Profile A:
Inference: High-end Windows desktop with standard DPI scaling
User Profile B:
Inference: Older MacBook with Retina display
Reports standardized fake values for all screen properties, including color depth. All Tor users appear identical.
Effectiveness: Complete protection
With fingerprinting protection enabled, may standardize or randomize color depth values.
Effectiveness: Partial protection
You can technically change your display's color depth in operating system settings, but:
Some anti-fingerprinting extensions spoof screen.colorDepth, but:
Color depth is a minor fingerprinting concern. Don't sacrifice usability to protect against it. Instead, use comprehensive privacy tools that address all fingerprinting vectors simultaneously.