WCAG color palette fixer

To fix a color contrast failure, darken or lighten the text or background color until the pair reaches the WCAG ratio you need: 4.5:1 for AA normal text, 3:1 for AA large text, or 7:1 for AAA. This tool suggests the nearest passing color so the original hue stays recognisable.

Enter a text color and background color, choose AA or AAA, then adjust either color until the pair passes the WCAG contrast threshold. Copy the passing hex or CSS values when it does.

Enter a six-digit hex color.

Enter a six-digit hex color.

Set a WCAG target

Pick the level and text size, then adjust either color until the pair passes.

WCAG level

Text size

Target AA normal text needs 4.5:1 — Pass at 17.74:1

Text #111827
Background #ffffff

--foreground: #111827;
--background: #ffffff;

Normal text preview — The quick brown fox jumps over the lazy dog.

Large text preview — Aa 123

Contrast ratio: 17.74:1

Normal text AA (4.5:1)Pass
Normal text AAA (7:1)Pass
Large text AA (3:1)Pass
Large text AAA (4.5:1)Pass

WCAG text contrast thresholds

A ratio runs from 1:1 for two identical colors to 21:1 for black on white. The table shows the minimum ratio for each level and text size.

Text sizeAAAAA
Normal text4.5:17:1
Large text3:14.5:1

Large text is at least 18 point regular or 14 point bold, roughly 24px regular or 18.66px bold in CSS pixels. Anything smaller uses the normal text thresholds. These figures come from the W3C contrast minimum guidance.

Fix a palette with real website colors

Start from a color pair you already like, then use the target controls to nudge only as far as the pass mark. You can also open a pair in the WCAG color contrast checker, build a palette from one brand color with the accessible color palette generator, browse accessible website color palettes, or explore all website color palettes for starting points.

Frequently asked questions

What ratio does WCAG AA need for text?

WCAG 2.2 level AA asks for at least 4.5:1 between normal text and its background. Large text, which is about 24px regular or 18.66px bold, needs at least 3:1.

What changes at WCAG AAA?

Level AAA raises the minimum to 7:1 for normal text and 4.5:1 for large text. Choose AAA in the fixer above when the text must meet the stricter level.

Should I change the text color or the background?

Either works, because contrast is measured between the two colors. Change the text color to keep a branded background, or change the background to keep a branded text color. Use Adjust both colors when one change alone cannot reach the target.

Is a passing ratio enough for accessible text?

No. Contrast is one requirement. Also check hover, focus and disabled states, text over images, readable font sizes, keyboard access and alternative text across the page.

More color tools

Image tools

CSS generators

Image & SVG tools

Typography & units

More free tools

All free tools