Skip to main content

WCAG 2.2 Color Contrast Checker

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…

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.

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 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.

Frequently asked questions
Why does 4.50:1 fail WCAG AA?
The ratio is displayed rounded to two decimals, but WCAG thresholds are compared with the exact value. A pair at 4.4998:1 rounds to 4.50 yet is still below 4.5:1, so the checker marks AA normal text as failing and shows the exact ratio.
What counts as large text in WCAG 2.2?
WCAG defines large text as at least 18 point, or 14 point bold, which is roughly 24px, or 18.66px bold, in CSS. Large text needs 3:1 for AA and 4.5:1 for AAA; normal text needs 4.5:1 and 7:1.
How are transparent colors measured?
A translucent foreground is blended over the background, and a translucent background over the backdrop color, per sRGB channel, the same way browsers paint them. The ratio is computed from the resulting opaque colors, never from the raw alpha values.
How does the nearest accessible color work?
It converts the color to OKLCH, keeps the hue, and binary-searches lightness in the direction that raises contrast. If the target cannot be reached inside sRGB, it lowers chroma step by step. The suggested hex is re-checked with the exact ratio, and nothing changes until you select Apply.

CodingTool is officially live on