WCAG Color Contrast Explained
3 min readUpdated June 7, 2026
Color contrast is the measurable difference in brightness between two colors — usually text and the background behind it. The Web Content Accessibility Guidelines (WCAG) turn that difference into a single number called a contrast ratio, so you can check whether real people will actually be able to read your interface instead of guessing.
This guide explains what the ratio means, the specific thresholds WCAG sets for AA and AAA compliance, why those numbers matter beyond box-ticking, and the most reliable way to fix a color pair that fails.
What a contrast ratio actually measures
A contrast ratio compares the relative luminance — the perceived brightness — of two colors. It is not about hue. Red and green can look wildly different and still have almost identical brightness, which is exactly why they can fail contrast while looking 'colorful' to someone with full vision.
Ratios run from 1:1 to 21:1. A color against itself is 1:1 (invisible). Pure black text on pure white is the maximum, 21:1. Everything readable lives somewhere in between. The formula uses relative luminance, calculated from the red, green, and blue channels with green weighted most heavily, because the human eye is most sensitive to green light.
The WCAG thresholds: AA and AAA
WCAG defines two conformance levels. Level AA is the practical, widely-adopted target and the one most laws and policies reference. Level AAA is a stricter, enhanced bar that is often impractical to hit across an entire site.
For AA: normal body text needs a ratio of at least 4.5:1, while large text needs only 3:1. Non-text elements that convey meaning — UI components, icons, focus indicators, chart segments, and graphical objects — also need at least 3:1 against their neighbors.
For AAA: normal text rises to 7:1 and large text rises to 4.5:1. 'Large text' has a precise definition: at least 18pt (about 24px), or 14pt (about 18.66px) when bold. Larger, heavier glyphs are easier to read, so WCAG relaxes the requirement for them.
Why contrast matters
The obvious reason is legibility. Low-contrast text is fatiguing for everyone and genuinely unreadable for many — people with low vision, color vision deficiency, or aging eyes, and anyone using a dim screen in bright sunlight. Good contrast is one of the highest-leverage accessibility wins available.
There is also a legal dimension. WCAG AA is the de facto standard referenced by accessibility laws and regulations in many jurisdictions, including public-sector and commercial procurement requirements. Failing contrast is one of the most common — and most easily detected — accessibility violations, which makes it a frequent target in audits and complaints.
How to fix failing contrast
The single most effective fix is to adjust lightness, not hue. Because the ratio is driven by luminance, nudging a color toward black or white moves the number far more than swapping it for a different but equally-bright hue. If light text fails on a light background, darken the background or lighten the text until the ratio clears the threshold.
Work in a perceptual color space like HSL, HSLuv, or OKLCH so you can change lightness while keeping the hue and a recognizable amount of saturation. Resist the urge to simply pick a 'nicer' shade of the same brightness — it will not help. Re-measure after every change, and remember that hover, focus, disabled, and placeholder states each need to pass on their own.
Frequently asked questions
What is the minimum WCAG contrast ratio for normal text?+
4.5:1 for WCAG AA. AAA raises it to 7:1. Large text (18pt, or 14pt bold) only needs 3:1 for AA and 4.5:1 for AAA.
What counts as 'large text' in WCAG?+
Text that is at least 18pt (roughly 24px), or 14pt (roughly 18.66px) when bold. Larger, heavier text gets a lower contrast requirement because it is easier to read.
Do icons and buttons need to meet contrast requirements?+
Yes. Non-text elements that convey meaning — UI components, icons, focus indicators, and graphical objects — need at least 3:1 against adjacent colors under WCAG AA.
My colors fail contrast. What should I change first?+
Adjust lightness, not hue. The ratio is based on luminance, so moving a color lighter or darker fixes it far more reliably than switching to a different but equally-bright color.
Does contrast depend on the colors I pick or just the brightness?+
It depends on relative luminance — perceived brightness — not hue. Two vivid colors can clash visually yet still fail contrast if their brightness is too similar.
Related guides
Color Harmony: Complementary, Analogous & Triadic
Color harmony is the art of choosing colors that look deliberate together rather than accidental. It is not mysterious taste — it is geometry. Almost every…
HEX, RGB and HSL Color Codes Explained
Open any stylesheet and you'll find colors written in several different ways — #ff0000, rgb(255, 0, 0), and hsl(0, 100%, 50%). These all describe the exact…