Color Contrast Ratios Explained
Light gray text on white looks elegant and is hard to read. The Web Content Accessibility Guidelines put numbers on it.
Check your colorsEnter two colors and see their contrast ratio.
Open the tool →
The requirement
Success Criterion 1.4.3 in WCAG 2.1, at level AA, requires a contrast ratio between text and its background of at least 4.5:1 for normal text. For large text the ratio is 3:1. Large text means 18 point or larger, or 14 point and bold, which is roughly 24 px or 18.5 px. The ratios are not rounded, so a computed 4.499:1 does not pass.
The exceptions
- Text in inactive interface elements, such as disabled buttons.
- Pure decoration, or text that nobody can see.
- Text that is part of a logo or brand name.
The stricter level
A higher level, AAA (criterion 1.4.6), asks for 7:1 for normal text.
Using it with a palette
When you build a palette, the text and background colors matter more than the other colors. Test the pairs you will really use, and darken the text or lighten the background until the ratio passes. Pale colors on white are the most common failures.
How the ratio is calculated
The ratio compares the relative luminance of the lighter color (L1) with that of the darker color (L2): (L1 + 0.05) ÷ (L2 + 0.05). Luminance is a weighted sum of the red, green and blue channels, with green counting most: L = 0.2126 R + 0.7152 G + 0.0722 B. Before weighting, each channel (0 to 255) is divided by 255 and then converted from its screen encoding to a linear value. Ratios run from 1:1 (no difference at all) to 21:1 (black on white).
Worked examples (our own arithmetic)
- Black on white: (1 + 0.05) ÷ (0 + 0.05) = 21:1.
- Medium gray #767676 on white: about 4.54:1, which just passes the 4.5:1 level for normal text.
- Gray #777777 on white: about 4.48:1, which just fails. One step in the hex code decides the result, and because ratios are not rounded, 4.48 is a fail.
- Light gray #999999 on white: about 2.85:1, which fails even the 3:1 level for large text.
- Pure blue #0000FF on white: about 8.6:1. Blue is dark in luminance even though it looks vivid.
Buttons, icons and form borders
WCAG also has a separate criterion for non-text parts of an interface, 1.4.11 Non-text Contrast. It asks for at least 3:1 for the graphics and controls a person needs to see to use a page, such as a form field border or an icon with no label. Disabled controls are exempt.
Practical checks
- Test the real pairs: body text on the page background, link color on the background, text on buttons, and placeholder text in fields.
- Thin or unusual fonts may need more contrast than the minimum in practice.
- Text over a photo or gradient should be tested at its worst spot, not its average.
- Contrast is one part of accessibility. Pair it with a readable size and a non-color cue, as explained in Color Blindness and Design.
Check your colorsEnter two colors and see their contrast ratio.
Open the tool →
Sources
Checked on October 25, 2026. We summarize in our own words and only state what these sources support.
- W3C: Understanding Success Criterion 1.4.3 Contrast (Minimum) — required ratios, large text definition and exceptions
- W3C: Understanding Success Criterion 1.4.3 (formulas, 21:1 scale, UI components note) — luminance and ratio formulas