Color Relative Luminance Table
WCAG luminance and contrast for a list of colors, in one table.
| Color | Luminance | On white | On black | Best text |
|---|
How WCAG relative luminance works
WCAG measures contrast with relative luminance. Each sRGB channel is divided by 255, then turned into linear light: values up to 0.04045 are divided by 12.92, and higher values become ((c + 0.055) ÷ 1.055) raised to 2.4. The luminance is 0.2126 × red + 0.7152 × green + 0.0722 × blue, from 0 for black to 1 for white. (The WCAG 2.0 text listed 0.03928 as the cutoff; no 8-bit value falls between the two, so the result is the same.)
Paste your palette and the table shows each color's luminance and its contrast ratio against white and black text, with a check where it meets the 4.5:1 AA minimum for normal text. For example, #777777 has a luminance of 0.1845: 4.48:1 on white, which just fails, and 4.69:1 on black, which passes.
Private and in your browser
Everything runs locally in your browser. Your colors are never uploaded, and the copy button always uses the current table.
Frequently asked questions
What is relative luminance?
It is how bright a color is on a scale from 0 (black) to 1 (white), as WCAG defines it. Each sRGB channel is turned into linear light, then weighted: L = 0.2126 R + 0.7152 G + 0.0722 B. Green counts most because our eyes are most sensitive to it.
How is the contrast ratio worked out?
(L1 + 0.05) ÷ (L2 + 0.05), with the lighter color's luminance as L1. WCAG AA needs 4.5:1 for normal text and 3:1 for large text; AAA needs 7:1 and 4.5:1.
Why does #777777 fail on white?
Its luminance is 0.1845, so on white the ratio is 1.05 ÷ 0.2345 = 4.48:1, just under the 4.5:1 AA minimum. The table rounds ratios down, so a near miss never looks like a pass.
Does it upload my input?
No. The Color Relative Luminance Table runs entirely in your browser. Your input is never uploaded, and it keeps working offline once the page has loaded.
Related tools
Practical utilities for front-end design and implementation work.