Skip to content
K Knidox Search…
Tools · Design

Color Contrast Checker

Check the WCAG contrast ratio between two colors and see AA and AAA results.

A 6- or 3-digit hex code, e.g. #767676 or #777.
A 6- or 3-digit hex code, e.g. #FFFFFF or #FFF.
Live preview

Large heading text

The quick brown fox jumps over the lazy dog. Small body copy at a normal reading size.

Contrast ratio
4.54:1AA normal · pass

Higher is better. The WCAG scale runs from 1:1 (no contrast) up to 21:1 (black on white).

AA · normal textPass
AA · large textPass
AAA · normal textFail
AAA · large textPass

The contrast ratio between two colors is a single number from 1:1 to 21:1 that measures how different their brightness is. For normal body text, WCAG AA needs a ratio of at least 4.5:1; large text needs 3:1. Black on white scores the maximum, 21:1.

Why contrast matters

Text that sits too close in brightness to its background is hard to read — especially for people with low vision, colour-blindness, or anyone squinting at a phone in bright sunlight. The Web Content Accessibility Guidelines (WCAG) turn “readable enough” into a measurable rule: the contrast ratio between the text colour and the colour behind it.

The ratio compares the two colours’ relative luminance — a measure of perceived brightness that weights green most, then red, then blue. It runs on a scale from 1:1 (the two colours are identical, so the text is invisible) up to 21:1 (pure black on pure white). The higher the number, the easier the text is to read.

contrast ratio = (L₁ + 0.05) ÷ (L₂ + 0.05)

L₁ is the lighter colour’s relative luminance, L₂ the darker; each L is 0.2126R + 0.7152G + 0.0722B on linearized channels.

  1. 1
    Enter your two colors. Type the text (foreground) and background colours as hex codes, e.g. #767676 on #FFFFFF.
  2. 2
    Read the ratio. The tool converts each colour to relative luminance and divides: #767676 on #FFFFFF gives about 4.54:1.
  3. 3
    Check the AA and AAA badges. 4.54:1 clears the 4.5:1 AA threshold for normal text, so the AA · normal badge shows Pass.
  4. 4
    Adjust if it fails. If a badge fails, darken the text or lighten the background and watch the ratio climb until it passes the level you need.

WCAG contrast thresholds

Large text is 18.66px (14pt) bold or 24px (18pt) regular and larger. Ratios are minimums.

RequirementMinimum ratio
AA — normal text4.5:1
AA — large text3:1
AAA — normal text7:1
AAA — large text4.5:1
UI components & graphics (AA)3:1

Reading the result

AA is the level most sites and legal accessibility standards target; AAA is a stricter enhanced level that is not always achievable for every design. A colour pair only needs to meet the threshold for the level and text size you are actually using — a large heading passes AA at 3:1, while the same colour on small captions would need 4.5:1.

Two cautions. First, contrast alone doesn’t make text readable — a thin or decorative typeface can still be hard to read at a passing ratio. Second, the ratio is symmetric: swapping the text and background colours gives the same number, so light-on-dark and dark-on-light versions of a palette score identically.

What contrast ratio do I need?
For WCAG AA, normal body text needs at least 4.5:1 and large text needs 3:1. To meet the stricter AAA level, use 7:1 for normal text and 4.5:1 for large text.
What counts as large text?
Large text is at least 24px (18pt) for regular weight, or 18.66px (14pt) when bold. At that size the eye tolerates lower contrast, so the AA threshold drops from 4.5:1 to 3:1.
What is the difference between AA and AAA?
AA is the standard conformance level most websites and accessibility laws target. AAA is an enhanced level with higher ratios (7:1 for normal text) that is harder to meet and isn’t required for every piece of content.
How is the contrast ratio calculated?
Each colour is converted from sRGB to relative luminance (a brightness measure), then the ratio is (L₁ + 0.05) ÷ (L₂ + 0.05), where L₁ is the lighter colour and L₂ the darker. The result ranges from 1:1 to 21:1.
Does the order of the two colors matter?
No. The formula always divides by the lighter and darker luminance, so swapping foreground and background gives the identical ratio. Black on white and white on black both score 21:1.
Do icons and buttons need to pass too?
Yes. Under WCAG AA, meaningful graphics and the visual boundaries of user-interface components need a 3:1 contrast ratio against what’s next to them, even though that’s lower than the 4.5:1 required for normal text.
Why does my brand color fail on white?
Many mid-tone colours — medium greys, oranges, and yellows especially — are too bright to reach 4.5:1 on white. Darken the colour for text use, or reserve the lighter shade for large headings and non-text elements that only need 3:1.