WCAG needs a contrast ratio of 4.5:1 for normal text and 3:1 for large text (18pt / 24px, or 14pt bold) to pass AA; AAA needs 7:1 and 4.5:1. The ratio is (L1 + 0.05) / (L2 + 0.05) where L is relative luminance โ€” black on white is the maximum, 21:1, and the lightest gray passing AA on white is #767676 at 4.54:1. Enter your two colors below for the exact ratio, verdicts for all four text tiers plus non-text UI, and the nearest shade that passes if you fail.

Check a color pair

4.54:1
L(#767676) = 0.1812 ยท L(#ffffff) = 1.0000
Previewnormal 16px ยท large 24px ยท UI border
Large text 24px โ€” reads at 3:1
Normal text 16px โ€” needs 4.5:1. The quick brown fox jumps over the lazy dog.
UI component border โ€” 3:1
Tip: paste #rrggbb, #rgb, or use the swatches. Results encode in the URL โ€” copy the share link to file the verdict in a ticket.
Advertisement

WCAG Requirements at a Glance

TierText sizeMinimum ratioWhere it applies
AA (1.4.3)Normal4.5:1Body copy, labels, links, placeholders
AA (1.4.3)Large โ€” 18pt/24px, or 14pt bold3:1Headings and display type
AAA (1.4.6)Normal7:1Enhanced tier; long-form reading, low-vision users
AAA (1.4.6)Large4.5:1Enhanced tier headings
AA (1.4.11)Non-text3:1Icons, input borders, focus rings, chart lines

Verified Common Pairs

PairRatioAA normalAAA normalNote
#767676 on #ffffff4.54:1PassFailLightest AA gray on white
#777777 on #ffffff4.48:1FailFailThe classic near-miss
#595959 on #ffffff7.00:1PassPassLightest AAA gray on white
#2563eb on #ffffff5.17:1PassFailTailwind blue-600 link color
#dc2626 on #ffffff4.83:1PassFailred-600 error text
#16a34a on #ffffff3.30:1FailFailgreen-600: large text/UI only
#f59e0b on #ffffff2.15:1FailFailamber-500 needs dark text instead
#f59e0b on #0000009.78:1PassPassSame amber on black sails
#000000 on #ffffff21.00:1PassPassThe maximum possible ratio

Ratios computed with the WCAG 2.x relative-luminance formula and verified against reference implementations, including the BBC's open-source Apache-licensed color-contrast-checker that popularized AA/AAA pass-fail reporting.

How the Contrast Ratio Works

The ratio compares the relative luminance of the two colors โ€” not their perceived darkness, which is why eyeballing fails. Each sRGB channel is linearized (values below 0.04045 divide by 12.92; above that, they follow ((c + 0.055) / 1.055)^2.4), then combine as 0.2126 R + 0.7152 G + 0.0722 B. The ratio is the lighter plus 0.05 over the darker plus 0.05, which puts it between 1:1 (identical colors) and 21:1 (black on white).

A worked example

Take #767676 text on white. The channel value is 118, so 118/255 = 0.4627, which linearizes to 0.1812 for all three channels โ€” luminance is therefore 0.1812. White's luminance is 1.0, so the ratio is (1.0 + 0.05) / (0.1812 + 0.05) = 4.54:1. That clears AA normal text (4.5:1) and AAA large text, but not AAA normal text (7:1). Darken one step to #595959 and the ratio hits exactly 7.00:1 โ€” the AAA line. One step lighter, #777777, drops to 4.48:1 and fails AA: the pass/fail boundary sits between two adjacent grays, which is the trap that makes a checker worth running.

Reading the verdict chips

If a pair fails, the Fix to nearest AA pass button walks the failing color toward the other one in the smallest steps that reach 4.5:1 โ€” the same logic that turns #777777 body copy into #767676 โ€” so the change stays as close to your original palette as hex granularity allows.

Frequently Asked Questions

What contrast ratio do I need to pass WCAG?

AA, the threshold most laws and contracts enforce, needs 4.5:1 for normal text and 3:1 for large text. AAA, the enhanced tier, needs 7:1 for normal text and 4.5:1 for large text. Separately, non-text elements like icons, input borders, and focus indicators need 3:1 under success criterion 1.4.11.

What counts as large text in WCAG?

Text is large at 18 point (24 CSS pixels) regular weight, or 14 point (roughly 18.7 pixels) bold. Everything smaller is normal text and must meet the stricter ratio, which is why body copy is where contrast failures cluster.

Why does #777777 text on white fail when it looks fine?

It measures 4.48:1, two hundredths short of the 4.5:1 AA line. The lightest gray that passes AA on white is #767676 at 4.54:1. Mid-gray on white is the single most common failure because screens and antialiasing make it look more readable than the math says it is.

Do contrast rules apply to icons, buttons, and placeholders?

Yes. Icons, chart lines, focus rings, and input borders are non-text UI components and need 3:1 against adjacent colors (WCAG 1.4.11). Placeholder text is real text: it must meet 4.5:1, which is why the classic pale-gray placeholder fails.

Are logos exempt from contrast requirements?

Logotypes and purely decorative elements are exempt. Incidental text, such as a photo of a sign inside an image, is also exempt. Everything a user must read or operate still has to meet the ratios.

How do I fix a color pair that fails?

Darken the text or lighten the background until the ratio clears the threshold โ€” the checker's fix-it button finds the nearest shade that passes, moving the failing color toward the other one in the smallest steps possible. Avoid fixing by thin weights or tiny type, and never rely on color alone to carry meaning.

Advertisement