Color Contrast Checker

Check a text and background color pair against WCAG AA and AAA, and get the closest color that passes.

Contrast ratio

4.83:1

  • AA · normal text (≥ 4.5:1, SC 1.4.3)✓ Pass
  • AA · large text (≥ 3:1, SC 1.4.3)✓ Pass
  • AAA · normal text (≥ 7:1, SC 1.4.6)✗ Fail
  • AAA · large text (≥ 4.5:1, SC 1.4.6)✓ Pass
  • AA · UI components & graphics (≥ 3:1, SC 1.4.11)✓ Pass

Large text means at least 24px (18pt) regular or 18.66px (14pt) bold.

Closest passing text color (same hue)

AA (4.5:1): already passes.

#535967AAA (7:1) → 7.01:1

Normal text (16px). The quick brown fox jumps over the lazy dog — needs 4.5:1 for AA.

Large text (24px regular) — 3:1 for AA

Large bold text (18.66px bold) — 3:1 for AA

Input borderUI parts and icons — 3:1 (SC 1.4.11)

Why contrast matters

Text that is too close in brightness to its background is hard to read for people with low vision, for older users, and for anyone looking at a phone in sunlight. The Web Content Accessibility Guidelines (WCAG) turn this into a number: the contrast ratio, from 1:1 (identical colors) to 21:1 (black on white). Audits, procurement rules and accessibility laws in many countries reference WCAG 2.1 or 2.2 level AA, so failing contrast is one of the most common issues reported on real sites.

This checker computes that ratio for any pair of CSS colors, tells you which criteria pass, and — when one fails — proposes the nearest color of the same hue that would pass, so you can keep your brand look.

How to use it

  1. Enter the Text color and Background color — any hex, rgb(), hsl(), hwb() or color name — or use the pickers.
  2. Read the Contrast ratio and the pass/fail list for AA, AAA and UI components.
  3. If a level fails, look at Closest passing text color and press Use to try it.
  4. Check the samples on the right: normal 16px text, large 24px text, large bold 18.66px text, a border and an icon.
  5. Use ⇄ Swap to test the inverse (for example a dark-mode pair) and Copy ratio for your report.

Worked example

Light grey placeholder text, #9CA3AF on #FFFFFF, gives 2.53:1. It fails every text criterion and also the 3:1 non-text check. The tool suggests #717782 (4.50:1) for AA and #535964 (7.04:1) for AAA — both keep the slightly blue tint of the original grey.

The default pair, #6B7280 on white, reaches 4.83:1: it passes AA for all text sizes and AAA for large text, but not AAA for normal text.

What the results mean

CriterionMinimum ratioApplies to
1.4.3 AA4.5:1Normal text
1.4.3 AA3:1Large text (≥ 24px, or ≥ 18.66px bold)
1.4.6 AAA7:1Normal text
1.4.6 AAA4.5:1Large text
1.4.11 AA3:1Input borders, focus rings, icons, chart lines

The ratio is (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker color, computed from linearised sRGB with the weights 0.2126, 0.7152 and 0.0722. If you enter a translucent color, the background is placed over white and the text over that background before measuring, which is what a browser would display on a white page.

Limitations

The WCAG 2 formula is known to overrate some combinations (such as mid-tone orange with white text) and underrate light text on dark backgrounds; it is still the measure audits use. The tool cannot judge text over images or gradients — test the lightest and darkest point behind the text separately. Disabled controls and pure decoration are exempt from the criteria, and logos have no requirement at all.

Tips

  • #767676 is the lightest neutral grey that passes AA on white; #595959 the lightest for AAA.
  • Check every state: hover, focus outlines, placeholder text and error messages often fail while body text passes.
  • Build a scale for your brand color with the color palette generator, then pick text shades from it here.
  • To see a translucent overlay as a solid color, use the color opacity calculator.

Frequently Asked Questions

What contrast ratio does WCAG require?

For level AA, normal text needs at least 4.5:1 and large text 3:1. For AAA, normal text needs 7:1 and large text 4.5:1. User-interface components and meaningful graphics need 3:1 (success criterion 1.4.11).

What counts as large text?

WCAG defines large text as at least 18 point (24 CSS pixels) at regular weight, or at least 14 point (about 18.66 CSS pixels) when bold. Anything smaller must meet the normal-text thresholds.

Is 4.49:1 close enough to pass AA?

No. The thresholds are minimums and WCAG does not allow rounding up, so this tool truncates the displayed ratio instead of rounding it, and a value just under 4.5 is reported as failing.

How is the suggested color chosen?

The tool keeps the hue and chroma of your text color in OKLCH and searches lighter and darker until the target ratio is reached, then offers whichever direction needs the smaller change. Click Use to apply it.

Does this tool use APCA?

No. It implements the WCAG 2.x contrast ratio, which is what current laws and audits reference. APCA, proposed for future guidelines, uses a different Lc lightness-contrast scale rather than ratios, so its results cannot be compared with 4.5:1.

Are my colors sent anywhere?

No. All calculations run in your browser and nothing you enter leaves your device.