WCAG 2.2 Color Contrast Checker

Runs locally in your browser

Check text and UI color contrast against WCAG 2.2 AA and AAA, then fix failing pairs

Colors

Text or icon color: HEX, rgb(), hsl(), oklch(), color(), or a CSS name.

Color behind the text or icon.

Advanced

Opaque page color behind a translucent background.

Preview

Contrast ratio

14.63 : 1

#1E293B on #FFFFFF

  • PassAA normal textSC 1.4.3 · 4.5:1 needed
  • PassAA large textSC 1.4.3 · 3:1 needed
  • PassAAA normal textSC 1.4.6 · 7:1 needed
  • PassAAA large textSC 1.4.6 · 4.5:1 needed
  • PassUI components & graphicsSC 1.4.11 · 3:1 needed
Normal text
The quick brown fox jumps over the lazy dog. Body text at 16px.
Large text
Heading at 24px
UI control

Previews use the composited colors that the ratio is measured from.

Suggestions

Finds the nearest color that meets the target. Hue stays the same, chroma is kept where possible, and only lightness changes.

Adjust foreground
Adjust background

This checks one color pair. Need to audit an entire page? Open Web Accessibility Checker

Restoring saved colors…

What is the WCAG 2.2 Color Contrast Checker?

The WCAG 2.2 Color Contrast Checker measures the contrast ratio between a foreground and a background color and reports pass or fail for AA and AAA text (SC 1.4.3 and 1.4.6) and for UI components and graphical objects (SC 1.4.11). It accepts HEX, rgb(), hsl(), hwb(), lab(), lch(), oklab(), oklch(), color() and CSS color names, previews the pair as text and as a control, and suggests the nearest accessible color when a pair fails.

How to use
  1. 1.Enter or pick a foreground and a background color.
  2. 2.Read the ratio and the pass/fail row for each WCAG 2.2 criterion.
  3. 3.Check the normal text, large text and control previews.
  4. 4.If a check fails, choose Adjust foreground or Adjust background to AA or AAA, compare the original and suggested colors, then select Apply.
  5. 5.Copy the result summary or the CSS declarations.
How the ratio is calculated

Each color is converted to sRGB and its relative luminance is computed with the WCAG formula (linearization threshold 0.04045). The ratio is (L1 + 0.05) / (L2 + 0.05). It is shown rounded to two decimals, but every pass/fail decision uses the unrounded value, so 4.499:1 fails AA even though it displays as 4.50:1. A translucent foreground is blended over the background, and a translucent background over the backdrop color (white by default), per sRGB channel, the way browsers paint them. Colors outside sRGB, such as vivid Display P3 or OKLCH values, are clipped to sRGB before measuring, and the tool says so.

Limits and privacy

The checker measures one color pair. It does not evaluate font rendering, text over images or gradients, or other WCAG criteria; use Web Accessibility Checker to audit a full page. WCAG 2.2 large text is at least 18 point, or 14 point bold (about 24px, or 18.66px bold). Colors are processed in your browser, and the last pair is saved only in this browser's local storage.

CodingTool is officially live on

Launched on StartupBaseCodingTool.dev - Free, Fast & Easy Developer Tools in One Place | Product HuntCodingTool - Featured on Startup FameFazier badgeListed on Turbo0Featured on Twelve ToolsFeatured on Findly.tools