Color contrast checker

Test text and background colours against WCAG 2.2 AA and AAA. If a pair fails, get the closest colours that pass — same hue, just lighter or darker — and check a whole palette at once.

  • Runs in your browser
  • Nothing uploaded
  • Free, no sign-up
0:1

    Large text — 24 px regular or 18.7 px bold

    Body text at 16 px. The quick brown fox jumps over the lazy dog. नेपाली पाठ पनि राम्रोसँग पढिनुपर्छ।

    Small print at 13 px — captions, footnotes and form hints.

    ButtonInput fieldA link
    Simulate

    Check a whole palette

    Every text/background combination appears here with its ratio. Click a cell to check that pair above.

    How to use it

    1. Enter two coloursType any CSS colour — #hex, rgb(), hsl(), oklch() or a name — or use the colour pickers. Transparent text colours are blended onto the background.
    2. Read the resultThe ratio is checked against WCAG 2.2 AA and AAA for normal text, large text and interface elements. The preview shows real text sizes and simulates colour blindness.
    3. Fix failing pairsPick the closest colour that passes — it keeps the hue, so your brand still looks like your brand. Paste a palette to test every combination at once.

    Questions

    What contrast ratio do I need?

    WCAG 2.2 level AA needs 4.5:1 for normal text and 3:1 for large text (24 px, or 18.7 px bold) and for icons, borders and other UI parts. Level AAA needs 7:1 for normal text and 4.5:1 for large text.

    How is the ratio calculated?

    From the relative luminance of the two colours: (lighter + 0.05) ÷ (darker + 0.05), giving a value from 1:1 (same colour) to 21:1 (black on white). Results are not rounded up — 4.49:1 fails AA.

    What is APCA?

    The Accessible Perceptual Contrast Algorithm, a newer method being considered for future guidelines. It accounts for font size and whether the text is light-on-dark. It’s shown for reference; WCAG 2.2 is what laws and audits use today.

    Does the colour-blindness simulation affect the ratio?

    No. Contrast ratio depends on luminance, which colour blindness doesn’t change much. The simulation helps you check that you don’t rely on hue alone — for example red and green status colours.

    Is anything sent to a server?

    No. All calculations run in your browser.