Developer

WCAG Color Contrast Explained: AA and AAA Ratios

Readable text is the foundation of an accessible interface, and readability comes down to contrast between the text and its background. What the WCAG contrast ratio measures, the 4.5:1 and 7:1 thresholds for AA and AAA, and how the rules change for large text and interface components.

Awais 2 min readPublished
WCAG Color Contrast Explained: AA and AAA Ratios

Readable text is the foundation of an accessible interface, and readability comes down to contrast between the text and its background. The Web Content Accessibility Guidelines (WCAG) define exact contrast ratios that color combinations must meet. The ToolOrbit Color Contrast Checker computes that ratio and tells you instantly whether a pairing passes AA or AAA.

How the contrast ratio is calculated

WCAG measures contrast as the ratio between the relative luminance of the lighter color and the darker color. The result ranges from 1:1 for identical colors up to 21:1 for pure black on pure white. The calculation accounts for how human eyes perceive different color channels, so it is not a simple difference of brightness.

#595959 on #FFFFFF  ->  7.0:1  (AAA pass)
#777777 on #FFFFFF  ->  4.48:1 (AA pass, AAA fail)
#AAAAAA on #FFFFFF  ->  2.32:1 (fail)

What the WCAG thresholds require

  • AA normal text: at least 4.5:1
  • AA large text (18pt or 14pt bold): at least 3:1
  • AAA normal text: at least 7:1
  • AAA large text: at least 4.5:1
  • UI components and graphical objects: at least 3:1
Tip: Large text gets a lower threshold because bigger shapes are easier to read. Confirm your font actually qualifies as large before relying on the relaxed 3:1 ratio.

Using the checker

Enter a foreground and background color as hex values and the checker shows the ratio along with clear pass or fail badges for each WCAG level. Adjust the colors until you clear the threshold you are targeting. Everything is calculated in your browser, with a live preview so you can judge readability with your own eyes too.

Best practices

Design for AA as a baseline and reach for AAA on body text where you can. Never rely on color alone to convey meaning, since contrast helps low-vision users but not those who cannot distinguish hues. Check your hover, focus, and disabled states as well, because they are easy to forget and often fall below the line.

Large-text and component rules

WCAG gives large text an easier bar (3:1) than normal text (4.5:1) because thicker letterforms tolerate lower contrast. That only helps sizes like 18pt (24px) regular or 14pt (18.66px) bold and above — a slightly bigger button label still needs the full ratio. Non-text UI like focus indicators and icon boundaries want at least 3:1 against their backgrounds, which is exactly why a checker with a live ratio readout beats eyeballing it in design tools.

  • Design in gray-scale-light contrast? No — test actual pairs.
  • Focus styles: check the ring color against both the background and the bordered element.
  • Test on both the light theme and the dark theme; ratio flips between them.

Tools mentioned

More reading

View all guides
Free Developer Tools Online: 2026 Developer Toolkit & Guides
Developer

Free Developer Tools Online: 2026 Developer Toolkit & Guides

Explore 30+ free browser-based developer tools: JSON formatters, Base64 converters, cron generators, regex testers, SQL formatters, and hash generators.

3 min readPublished
CSS Border Radius: 15 Copy-Paste Examples
Developer

CSS Border Radius: 15 Copy-Paste Examples

15 modern CSS border radius examples: rounded cards, pills, circle avatars, asymmetrical organic blobs, and fancy 8-value border radius shapes.

3 min readPublished
Percent Encoding Reference Table (Every Character)
Developer

Percent Encoding Reference Table (Every Character)

Complete percent encoding ASCII reference table: quick lookup for spaces, slashes, ampersands, punctuation, and UTF-8 special characters in URLs.

3 min readPublished
URL Encoding Explained: %20 vs +, Reserved Characters & Rules
Developer

URL Encoding Explained: %20 vs +, Reserved Characters & Rules

Complete guide to percent encoding in URLs: learn when to use %20 vs +, how reserved characters like & and ? work, and how to avoid encoding bugs.

3 min readPublished
Cron Every Hour, Day & Midnight: All Daily Schedules
Developer

Cron Every Hour, Day & Midnight: All Daily Schedules

Master standard daily cron schedules: cron every hour, every day at midnight, twice a day, and custom hourly intervals with copy-paste examples.

4 min readPublished
Cron Expression Cheat Sheet — Copy-Paste Schedule Examples
Developer

Cron Expression Cheat Sheet — Copy-Paste Schedule Examples

Free cron expression cheat sheet with copy-paste examples for every 5 minutes, hourly, daily at midnight, weekdays only, and more.

5 min readPublished
Cron Every 10 Minutes — Syntax, Examples and Best Practices
Developer

Cron Every 10 Minutes — Syntax, Examples and Best Practices

Use the cron expression */10 * * * * to run jobs every 10 minutes, plus examples for common schedules and troubleshooting tips.

3 min readPublished
Why CSV Is Tricky to Parse: Delimiters, Quotes and Headers
Developer

Why CSV Is Tricky to Parse: Delimiters, Quotes and Headers

Why CSV files are harder to read correctly than they look, how to choose the right JSON shape, and the mistakes to avoid.

2 min readPublished