WCAG 2.1 requires a minimum color contrast ratio of 4.5:1 for normal body text, 3:1 for large text (at least 24px regular or 18.66px bold) and 3:1 for user interface controls like input borders and buttons to pass Level AA. Stricter Level AAA raises those thresholds to 7:1 for body text and 4.5:1 for large text.
You can test any foreground and background pair immediately with our free Color Contrast Checker, then tweak lightness cleanly in HSL with our Hex, RGB & HSL Converter. Below are the exact WCAG 2.1 thresholds, how the contrast formula works and how to fix failing brand colors without changing their hue.
WCAG 2.1 contrast requirements at a glance
Accessibility contrast is measured as a ratio from 1:1 (identical colors, invisible) up to 21:1 (pure black #000000 on pure white #ffffff). Different elements have different minimums under WCAG 2.1 Success Criteria 1.4.3, 1.4.6 and 1.4.11:
| Element type | WCAG AA (standard) | WCAG AAA (enhanced) | Examples |
|---|---|---|---|
| Normal text | 4.5:1 | 7.0:1 | Body copy, labels, nav links, captions, table cells, placeholders |
| Large text | 3.0:1 | 4.5:1 | Headings at ≥24px (18pt) regular, or ≥18.66px (14pt) bold |
| UI components & graphics | 3.0:1 | Not separately defined | Input borders, outline buttons, focus rings, checkboxes, chart bars |
| Disabled or decorative elements | Exempt | Exempt | Disabled buttons, purely decorative dividers, brand logotypes |
How the WCAG contrast formula works
WCAG converts each sRGB hex channel to linear light, weights green heaviest because the human eye is most sensitive to green light, computes relative luminance L from 0 (black) to 1 (white), and compares the lighter color (L1) against the darker color (L2):
Contrast Ratio = (L1 + 0.05) ÷ (L2 + 0.05)
That weighting explains a common design surprise: pure bright yellow (#ffff00, luminance 0.93) has terrible contrast against white (1.07:1) and crisp contrast against black (19.56:1), whereas pure medium blue (#0000ff, luminance 0.07) works well on white (8.59:1) and fails badly on black (2.44:1).
How to fix a failing brand color without losing its identity
Most UI contrast failures happen in four predictable spots: light-grey secondary text on tinted cards, washed-out placeholder text, pale borders on outline buttons, and white text placed on bright orange, green or cyan buttons. Follow this repeatable workflow to fix them cleanly:
- Check the exact surface behind the text. A grey like
#737373clears 4.5:1 on pure white (4.74:1) but drops to4.39:1(Fail) the moment it sits on a#f5f5f5panel. Always test text against the actual tinted surface behind it, not just white. - Convert the failing hex code to HSL. Paste your color into the Hex, RGB & HSL Converter. HSL separates Hue (the color family), Saturation and Lightness.
- Adjust Lightness only while keeping Hue fixed. Lower Lightness (L) by 5% to 12% for text on light backgrounds, or raise L for text on dark surfaces, until the Color Contrast Checker clears 4.5:1 (or 3:1 for large headings and borders).
- Use two shades of a brand color when needed. Keep your bright brand hue for large accents, icons or borders, and pair it with a darker "text-safe" shade of the exact same hue for clickable links and white-text buttons.
- Check focus rings and control boundaries. Outline buttons and form fields need a border that reaches 3:1 against the surrounding panel (or a fill that differs by 3:1) so keyboard and low-vision users can spot clickable controls immediately.
Pair strong contrast with subtle elevation using our CSS Box Shadow Generator, and read our deeper references on WCAG contrast ratios and converting Hex, RGB and HSL.
Frequently asked questions
What is the minimum WCAG contrast ratio for normal body text?
WCAG 2.1 Level AA requires at least 4.5:1 contrast for normal body text against its background. Level AAA raises the requirement to 7:1 for enhanced readability.
What counts as large text in WCAG?
WCAG defines large text as at least 18pt (24px in CSS) at regular font weight, or at least 14pt (18.66px in CSS) at bold weight (700 or higher). Large text passes Level AA at 3:1 and Level AAA at 4.5:1.
Do placeholder text and input borders need to meet contrast rules?
Yes. Input placeholder text is treated as normal text and should meet 4.5:1, while form input borders, checkboxes, toggle tracks and focus indicators are user interface components that must meet at least 3:1 against their adjacent background under WCAG 2.1 SC 1.4.11.
Why does a color that passes on white fail on a light grey card?
Contrast depends on the relative luminance gap between both colors. Moving a background from pure white (#ffffff) to a light grey card (#f3f4f6) lowers the background luminance by about 10%, which pushes borderline mid-grey text (like #737373) below the 4.5:1 threshold.
How can I darken a brand color to pass AA without changing its color?
Convert the hex code to HSL, keep the Hue value unchanged and lower the Lightness percentage in small steps until the contrast ratio crosses 4.5:1. Using a darker shade of the same hue preserves brand recognition while making text readable in daylight.