Contrast Checker

Check whether a text and background color pair meets WCAG 2 contrast requirements.

HEX, rgb() or hsl()
HEX, rgb() or hsl()

Large text sample

Normal text reads like this. The quick brown fox jumps over the lazy dog.

CONTRAST RATIO

  • AA Normal text 4.5:1
  • AA Large text 3:1
  • AAA Normal text 7:1
  • AAA Large text 4.5:1

    GOOD TO KNOW

    About the contrast checker

    What is color contrast and why does it matter?

    Contrast ratio compares the brightness of two colors, from 1:1 (identical) to 21:1 (black on white). Text with too little contrast is hard to read for many people, including those with low vision, color blindness, a dim screen or bright sunlight on the display.

    The Web Content Accessibility Guidelines (WCAG) set minimum ratios so that text stays legible. Meeting them is also part of many accessibility laws and procurement requirements.

    WCAG AA and AAA requirements

    Level AA asks for at least 4.5:1 for normal text and 3:1 for large text (24px regular or 18.66px bold and up). Level AAA is stricter: 7:1 for normal text and 4.5:1 for large text.

    Most sites aim for AA. AAA is worth targeting for long reading content or when your audience is likely to include many people with low vision.

    How the ratio is calculated

    The checker converts each color to relative luminance, a measure of perceived brightness that weights green most and blue least, then divides the lighter value (plus 0.05) by the darker one (plus 0.05). The result is the same formula WCAG 2 defines, so the numbers match other WCAG checkers.

    Fixing a failing color pair

    If a pair fails, darken the text or lighten the background (or the reverse on dark designs). The suggestions below the score keep your hue and move only the lightness until the target ratio is met, so the fix still looks like your brand.

    REFERENCE

    WCAG contrast requirements at a glance

    These are the thresholds the checker tests. The ratio is the brightness difference between text and background.

    WCAG contrast ratio requirements
    ContentLevel AALevel AAA
    Normal text (under 24px, or under 18.66px bold)4.5 : 17 : 1
    Large text (24px+, or 18.66px+ bold)3 : 14.5 : 1
    Icons, borders and form controls3 : 1No separate requirement
    Logos and decorative elementsNo requirementNo requirement
    VISUAL GUIDE

    What different contrast ratios look like

    Black or white text on a range of grays. Notice how quickly text gets hard to read below 4.5:1.

    COMMON MISTAKES

    Popular color pairs, checked

    Some pairings look fine on a designer's monitor and still fail. Select one to open it in the checker.

    FROM THE COLLECTION

    The most readable pair in each curated palette

    For every Huegrove palette, the two colors with the highest contrast, ready to use as text and background.

    Browse all 50 palettes ↗

    FREE DOWNLOADS

    Download the reference files

    WCAG contrast requirements: 4.5:1 for normal text and 3:1 for large text at level AA, 7:1 and 4.5:1 at level AAA
    HOW IT WORKS

    Using the contrast checker

    FAQ

    Frequently asked questions

    What contrast ratio do I need for accessible text?

    At least 4.5:1 for normal text and 3:1 for large text to meet WCAG AA. For AAA you need 7:1 and 4.5:1.

    Does contrast apply to buttons and icons?

    WCAG 2.1 asks for at least 3:1 for essential user interface components and graphics, such as input borders and icons that carry meaning. Check them as a text and background pair here and compare to 3:1.

    What counts as large text?

    Text at 24px or larger, or 18.66px or larger if bold (18pt and 14pt bold in print terms).

    Does this checker support transparent colors?

    Yes. Colors with an alpha value are blended first: the text over the background, and the background over white.

    Is a passing ratio enough for accessibility?

    No. Contrast is one requirement. Font size, weight, spacing, focus indicators and not relying on color alone also matter. Treat a passing ratio as a baseline.

    KEEP GOING
    All tools ↗