Color Contrast Checker (WCAG)

RGB(30, 41, 59) · Luminance: 0.0218

RGB(255, 255, 255) · Luminance: 1.0000

Large Text Preview (24px+)

Normal body text at default size. This is what most of your content looks like — paragraphs, list items, and labels. Can you read this comfortably?

Small text (14px) — captions, footnotes, and helper text.

Contrast Ratio

14.63:1

Luminance: 0.0218 vs 1.0000

Normal Text

(<18px / <14px bold)

AAA

AA ≥ 4.5:1 · AAA ≥ 7:1

Large Text

(≥18px / ≥14px bold)

AAA

AA ≥ 3:1 · AAA ≥ 4.5:1

UI Components

(Icons, borders, focus)

Pass

SC 1.4.11 ≥ 3:1

WCAG 2.1 Quick Reference

ElementAAAAAYour Result
Normal text (<18px)4.5:17:114.63:1
Large text (≥18px / ≥14px bold)3:14.5:114.63:1
UI components (SC 1.4.11)3:114.63:1

Quick Test — Common Color Pairs

How to Use This Tool

  1. 1.Enter your foreground (text) color as a hex code like #1E293B, or click the color swatch to pick visually.
  2. 2.Enter your background color — the surface the text sits on. Use the “Quick Test” buttons to try common pairs instantly.
  3. 3.Read the contrast ratio (e.g., 12.63:1) and check the AA/AAA badges for normal text, large text, and UI components.
  4. 4.If your colors fail, use the suggested fix to find the closest color that passes AA while keeping the same hue.
  5. 5.Use the live preview panel to visually confirm readability at different text sizes before committing to a color choice.

Rate this tool

WCAG Contrast Requirements: What AA and AAA Ratios Mean for Your Design

A color contrast checker isn't optional anymore — it's a legal requirement. In 2019, Domino's Pizza lost a Supreme Court appeal after a blind user couldn't order food through their website, and the court ruled that the ADA applies to digital properties. Since then, web accessibility lawsuits in the US have surged past 4,600 per year, with contrast failures cited in the majority of complaints. The fix starts with one number: the WCAG contrast ratio between your text color and its background.

WCAG contrast ratio comparison showing passing and failing text contrast examples with AA and AAA compliance labels

The Lawsuit That Changed Web Color Choices

Before Robles v. Domino's Pizzareached the Supreme Court, most teams treated color accessibility as a nice-to-have. The ruling didn't create new law — it confirmed that Title III of the ADA covers websites. In the EU, the European Accessibility Act (EAA) takes full effect in June 2025, requiring WCAG 2.1 AA compliance for all commercial digital services. Australia's DDA, Canada's ACA, and the UK's Equality Act carry similar requirements. The common thread across every jurisdiction: WCAG 2.1 Level AA is the de facto benchmark, and its contrast ratios are the most frequently tested success criteria.

The numbers are specific. Normal body text must hit a contrast ratio of 4.5:1. Large text (18px regular or 14px bold and above) needs 3:1. UI components — form borders, icons that convey meaning, focus indicators — require 3:1 under Success Criterion 1.4.11, added in WCAG 2.1. Fail any of these and your site has a measurable, documented violation that a plaintiff's attorney can cite in a demand letter.

How the WCAG Formula Actually Works

The contrast ratio formula looks simple: (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 is the darker. The tricky part is computing relative luminance correctly. You can't just average the RGB channels — that ignores how human eyes perceive brightness.

Each sRGB channel (R, G, B) gets divided by 255, then run through a gamma expansion. Values at or below 0.04045 divide by 12.92. Everything above uses ((value + 0.055) / 1.055) ^ 2.4. The three linearized channels then combine with perceptual weights: 0.2126 × R + 0.7152 × G + 0.0722 × B. Green dominates because human vision has peak sensitivity around 555nm — green light. Red contributes about three times more than blue.

The 0.05 offset in the ratio formula isn't arbitrary. It models ambient light reflecting off the screen — even a fully black pixel (#000000) isn't truly zero luminance in a real viewing environment. The maximum possible contrast ratio under WCAG is 21:1, which occurs between pure black (L = 0) and pure white (L = 1): (1 + 0.05) / (0 + 0.05) = 21.

Worked Example: #767676 on White

Why does #767676 appear in every accessibility discussion? Let's calculate it. The hex value 76 converts to decimal 118. Divide by 255 to get 0.4627. Since 0.4627 > 0.04045, apply gamma: ((0.4627 + 0.055) / 1.055) ^ 2.4 = 0.1845. All three channels are identical (it's a pure gray), so relative luminance = 0.2126 × 0.1845 + 0.7152 × 0.1845 + 0.0722 × 0.1845 = 0.1845.

White has luminance 1.0. Plug into the ratio: (1.0 + 0.05) / (0.1845 + 0.05) = 1.05 / 0.2345 = 4.48:1. Wait — that's #777777. For #767676, the decimal is 118, and if you work through the precise sRGB linearization, you get luminance 0.1810, yielding (1.05) / (0.2310) =4.54:1. That 0.06-point difference is the gap between a legal failure and a pass. One hex digit.

This is why designers memorize #767676 as the boundary gray. Anything lighter on white fails AA. Need to verify a different pair? Paste both colors into our hex to RGB converter to extract the decimal channels, then check the ratio above.

AA vs. AAA — Which Level to Target?

Most accessibility laws worldwide reference Level AA, not AAA. But that doesn't mean AAA is irrelevant. Here's the practical breakdown:

CriteriaAAAAA
Normal text ratio4.5:17:1
Large text ratio3:14.5:1
Legal baseline in US, EU, AUYesNo
Achievable with most brand palettesUsuallyOften not
Recommended for critical contentMinimumIdeal

Target AA site-wide and AAA for anything users must read to complete a task: error messages, form labels, navigation links, and pricing information. Google's Material Design 3 system uses a similar approach — their “on-surface” text colors hit 7:1+ while decorative elements stop at 3:1.

The Large Text Exception That Trips Up Designers

WCAG defines “large text” as 18pt (24px) for regular weight, or 14pt (approximately 18.66px) for bold. At these sizes, the AA threshold drops from 4.5:1 to 3:1 because bigger letterforms are inherently more legible. But here's where teams get burned: CSS pixels aren't always the same as rendered pixels.

On a 2x Retina display, a 16px CSS font renders at 32 physical pixels. That doesn't make it “large text” under WCAG — the spec measures CSS pixel size, not device pixels. Font weight matters too. A 16px heading at font-weight 700 still isn't large text because 16px is below the 18.66px bold threshold. Only 14pt bold (roughly 19px in CSS) and above qualifies. Get this wrong and you'll design entire navigation bars with 3:1 contrast assuming they qualify as “large text” — then fail an audit.

When NOT to Rely on Contrast Alone

Contrast ratios measure luminance difference, but accessibility is broader than brightness. Two colors can pass 4.5:1 yet remain indistinguishable to someone with deuteranopia (green-red color blindness), which affects roughly 6% of males. Red text on a green background might compute to 5.1:1 contrast — technically AA-compliant — but roughly 300 million people worldwide couldn't tell them apart.

WCAG Success Criterion 1.4.1 says color must not be the only visual means of conveying information. If you're marking required form fields with red asterisks, add the word “required” too. Error states need icons or text labels alongside color changes. Charts should use patterns or labels, not just color coding. Pair this contrast checker with a color picker that lets you test multiple output formats and visually compare alternatives.

Fixing Failing Colors Without Destroying Your Brand

When brand colors fail contrast checks, the instinct is to make text darker. That works, but it's not the only lever. Adjusting the background is often less disruptive. A brand blue at #3B82F6 on white gives only 3.13:1 — an AA failure. Instead of darkening the blue to #1D4ED8 (which changes the brand feel), try tinting the background to #EFF6FF. Now the same #3B82F6 sits on a surface that shifts the luminance math enough to clear 3:1 for large headings, and you've kept your signature blue intact.

For body text, the hue-preserving trick works well: convert the failing color to HSL, keep hue and saturation identical, and reduce lightness until you hit 4.5:1. Our tool does this automatically in the “Suggested Fix” panel. The result is perceptually the same color family — just dark enough to pass. Generate a full set of accessible shades with the color palette generator once you've nailed the primary pair.

One more technique that's underused: semi-transparent overlays. If your hero section uses white text over a photograph, a background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)) behind the text guarantees minimum contrast regardless of the image content. The overlay darkens the photo just enough — and at 55% opacity, white text on any image will exceed 4.5:1 against the darkened pixels.

According to the W3C's Understanding SC 1.4.3 documentation, incidental text (logos, inactive controls, and purely decorative text) is exempt from contrast requirements. Disabled form buttons, watermarks, and brand logotypes don't need to meet 4.5:1 — but any text a user needs to read to operate your interface does.

Marko Sinko
Marko SinkoTechnical Tools Editor

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Marko builds and verifies the technical tools, number system converters, and scientific calculators across UnitCalcTools, ensuring mathematical precision and developer-friendly interfaces.

Last updated: April 14, 2026LinkedIn

Frequently Asked Questions

WCAG AA requires a minimum contrast ratio of 4.5:1 for normal-sized text (under 18px regular or 14px bold). For large text — 18px and above regular, or 14px and above bold — the threshold drops to 3:1. These ratios were derived from research on visual acuity loss, targeting readability for users with 20/40 vision.
The hex color #777777 on a white (#FFFFFF) background produces a contrast ratio of 4.48:1. That narrowly fails WCAG AA for normal text (needs 4.5:1) but passes the 3:1 threshold for large text. Darkening the gray by just one step to #767676 hits exactly 4.54:1, which is why #767676 is commonly cited as the lightest gray that passes AA on white.
The formula is (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 is the darker. Relative luminance converts each sRGB channel through a gamma expansion: divide by 255, then apply the formula 12.92 for values under 0.04045 or ((value + 0.055) / 1.055) ^ 2.4 for higher values. The 0.05 offset prevents division by zero and models ambient light reflection on screens.
No. The WCAG contrast ratio formula always puts the lighter luminance in the numerator, so swapping foreground and background gives the identical ratio. A 7.2:1 contrast between dark blue text on white stays 7.2:1 if you flip to white text on dark blue. What can change is perceived readability — light text on dark backgrounds often feels harder to read at small sizes even with the same ratio.
AA is the baseline legal standard most accessibility laws reference, requiring 4.5:1 for normal text and 3:1 for large text. AAA is the enhanced level at 7:1 for normal text and 4.5:1 for large text. AAA is harder to achieve with brand colors — pure white on Google blue (#4285F4) only reaches 3.3:1, failing both levels for body text. Most organizations target AA site-wide and AAA for critical content like error messages.
#767676 is the lightest pure gray that passes WCAG AA contrast against white (#FFFFFF), hitting exactly 4.54:1. One shade lighter at #777777 drops to 4.48:1 and fails. This makes #767676 a practical boundary marker — designers use it as the minimum gray for placeholder text, icon labels, and secondary UI text on white backgrounds.
WCAG 2.1 Success Criterion 1.4.11 requires non-text UI components and graphical objects to meet a 3:1 contrast ratio against adjacent colors. This includes icons, form borders, chart segments, and focus indicators. Decorative images are exempt, but any icon that conveys meaning — like a warning triangle or a navigation hamburger — must meet the 3:1 threshold.
Rarely. Two saturated colors often have similar luminance values, producing ratios below 3:1. For example, pure red (#FF0000) on pure blue (#0000FF) yields only 2.15:1 — a hard fail. The exception is pairing a bright warm color with a dark cool one: yellow (#FFFF00) on navy (#000080) reaches 12.87:1 because yellow has very high luminance (0.9278) while navy is extremely low (0.0183).

Related Tools