CODDY Tool

Contrast Checker

Check any colour pairing against the WCAG AA and AAA contrast requirements.

Enter a text colour and a background colour to get the exact contrast ratio and a pass or fail against every WCAG level. When a pairing fails, the tool suggests the nearest colour that passes while keeping your hue.

Everything you enter stays in this browser tab. Nothing is sent to our servers, logged or stored.

Loading tool…

What Contrast Checker supports

  • Check a pairingRatio and WCAG results.
  • Suggest a fixNearest passing colour.

About Contrast Checker

Contrast ratio is a number between 1 and 21 describing how far apart two colours are in perceived brightness. Black on white is 21:1. Identical colours are 1:1. WCAG sets the minimum for normal-size text at 4.5:1 for level AA and 7:1 for AAA, with lower bars for large text and interface elements.

The measurement is not a simple subtraction of the two colours. Screen values are gamma-encoded, meaning the number 128 does not represent half the light of 255 — it represents about 22% of it. Every ratio here linearises the channels first, which is what the WCAG formula specifies and what a surprising number of implementations skip. Skipping it produces answers that look plausible and are wrong exactly in the mid tones where most text sits.

Contrast is the single most commonly failed accessibility requirement on the web, and it is also the cheapest to fix. It affects far more people than the phrase 'colour blindness' suggests: anyone reading on a phone in daylight, on a cheap display, or with the ordinary vision changes that come with age.

How to check contrast

  1. Set your two colours

    Enter the text colour and the background colour in any format, or use the pickers. Swap them with one button.

  2. Read the result

    The ratio appears immediately, with a pass or fail for each WCAG level and a live preview at real text sizes.

  3. Fix a failure

    If the pairing fails, the suggested colour is the closest passing shade of your hue — so it still looks like your brand rather than defaulting to black.

What the levels require

  • AA, normal text — 4.5:1. This is the legal baseline in most jurisdictions and the one to design against.
  • AA, large text — 3:1. Large means 18pt and above, or 14pt and above when bold. Roughly 24px, or 19px bold.
  • AAA, normal text — 7:1. Aim for it in long-form reading; it is demanding for coloured text on white.
  • AAA, large text — 4.5:1.
  • Non-text elements — 3:1. Applies to icons, form field borders, focus rings and chart elements that carry meaning.

What the ratio does not tell you

Contrast ratio is a brightness measurement, so two colours with very different hues but similar brightness score badly even though many people can distinguish them easily. Red text on a green background of the same lightness is a classic example: it fails, and it should, because to a viewer with red-green colour blindness the two are nearly identical.

The reverse also holds. A pairing can pass comfortably and still be unpleasant — pure saturated blue on pure white passes AA, and reading a paragraph of it is genuinely unpleasant. Passing is a floor, not a design goal.

Finally, the ratio assumes flat colours. Text over a photograph or a gradient has a different contrast at every pixel; test against the lightest and darkest points it crosses, or put a solid scrim behind it.

Frequently asked questions

What counts as large text?

18 point or larger, or 14 point or larger if it is bold. In CSS pixels that is roughly 24px, or about 19px bold. The allowance exists because thicker letterforms remain legible at lower contrast — which also means a thin, light-weight font at 24px does not really earn the relaxation.

Do I have to meet AAA?

Usually not. AA is the level referenced by most accessibility legislation and the practical target for a product. AAA is worth pursuing for body text in anything read at length, but it is hard to reach with coloured text and is not expected across a whole interface.

Does contrast apply to disabled buttons and placeholder text?

Disabled controls are explicitly exempt from the contrast requirement. Placeholder text is not — it is real text, it is frequently the palest thing on the page, and it fails constantly. If your placeholder is the only label a field has, that is a separate and larger problem.

How does the suggested colour work?

It adjusts lightness in OKLCH until the ratio is met, holding the hue and saturation as steady as possible. That is why the suggestion still looks like your colour instead of collapsing towards grey, which is what adjusting in HSL tends to do.

Contrast Checker is free to use with no account, no watermark and no usage limits. Last updated 14 August 2026.