The monochrome media feature reports the number of bits per pixel in the output device’s monochrome frame buffer.
If the device is not monochrome, the value is 0 (typical color screens). A positive integer means a grayscale display. It is a range feature, so you can also use min-monochrome and max-monochrome. Pair it with color when you need to distinguish color vs grayscale capability.
Baseline · Widely available.
Not deprecated. Standard-track Media Queries Level 4 feature. Real monochrome hardware is rare — treat positive matches as progressive enhancement.
Simulated thick border for study; real match needs ≥ 2 bpp mono hardware.
How It Works
Thin default border. Fine for color screens.
Range feature.min-monochrome: 2 needs at least 2 bits/pixel.
Thicken details. Stronger edges help on limited grayscale depths.
Pair with max-. Use max-monochrome when you need an upper bound.
Edge Cases & Pitfalls
If nothing looks “grayscale,” you are probably on a color screen.
zero
Color devices report 0
Phones, laptops, and most monitors match (monochrome: 0), not the boolean (monochrome).
vs color
Different from the color feature
color measures color channel depth. monochrome measures grayscale buffer depth. Check both when classifying a device.
boolean
(monochrome) means > 0
Like other media features, the bare keyword is true when the value is non-zero.
range
Use min- / max- for thresholds
Exact (monochrome: 8) is brittle. Prefer min-monochrome / max-monochrome for ranges.
defaults
Do not rely on a positive match
True mono hardware is uncommon. Keep contrast and hierarchy clear without the query.
Compatibility
Browser Support
monochrome is a browser media feature. Node.js, Deno, and Bun do not evaluate it.
✓ Baseline · Widely available
monochrome
Widely supported in modern browsers (Chrome, Firefox, Safari, Edge 79+). Matching a positive bit depth still depends on real monochrome hardware.
97%Query support
Google Chrome4+
Full support
Mozilla Firefox2+
Full support
Apple Safari3.1+
Full support
Microsoft Edge79+
Full support
Opera10+
Full support
Samsung Internet4+
Full support
Internet Explorer—
No support
@media (monochrome)Widely supported
Bottom line: Safe to teach and use as progressive enhancement. Expect (monochrome: 0) on ordinary color devices. It is not a runtime API.
Remember
Key Takeaways
Role: report grayscale bits per pixel (0 = color device).
Boolean:(monochrome) matches when the value is > 0.
Range: use min-monochrome / max-monochrome for thresholds.
Practice: enhance for mono; never depend on it for everyday color UIs.
One line:0 means color; any positive value means grayscale bits — style accordingly, defaults first.
Frequently Asked Questions
It reports how many bits per pixel are in the device’s monochrome frame buffer. Color devices report 0. Positive integers mean a grayscale display.
The boolean form matches when the monochrome value is greater than 0 — any true monochrome device.
The output device is not monochrome (typical color screens). Most phones and monitors match (monochrome: 0).
color reports bits per color component on color devices. monochrome reports grayscale bit depth. A color phone usually matches color > 0 and monochrome: 0.
For e-readers, specialty grayscale hardware, or high-contrast fallbacks. On ordinary color screens the query rarely matches a positive value — keep solid defaults.
No. It is a CSS media feature evaluated by the browser layout engine, not a Node.js or server runtime feature.