Home / Color contrast checker

Color contrast checker

Enter a text color and a background color to see the contrast ratio and whether it passes WCAG accessibility guidelines.

Type or paste hex codes, or click the swatches to choose.

0:1

    Large text: the quick brown fox

    Normal text looks like this. Most body copy on websites is 16px, so this is the size that needs at least 4.5:1 contrast to meet WCAG AA.

    Button outline
    Advertisement

    What the contrast ratio means

    Contrast ratio compares the brightness of two colors on a scale from 1:1 (identical colors, unreadable) to 21:1 (black on white). The higher the ratio, the easier text is to read, especially for people with low vision or color blindness, and for anyone reading a phone in bright sunlight.

    The Web Content Accessibility Guidelines (WCAG) set the minimums most websites aim for. Many countries use WCAG level AA as the legal accessibility standard.

    WCAG contrast requirements

    WhatAA (minimum)AAA (enhanced)
    Normal text4.5:17:1
    Large text (24px+, or 18.66px+ bold)3:14.5:1
    Icons, buttons, form borders and chart lines3:1Not defined

    Logos and purely decorative text don't have a contrast requirement.

    How to fix low contrast

    • Use the suggestion. When a pair fails, the checker suggests the nearest text color that passes, keeping the same hue.
    • Change lightness, not hue. Contrast depends on brightness. Swapping blue for green barely helps; making the text darker or lighter does.
    • Watch out for gray text. Light gray on white is the most common failure on the web. #767676 is the lightest gray that passes AA on white.
    • Make it bigger. If you can't change the colors, larger or bold text only needs 3:1.

    How contrast ratio is calculated

    Each color's relative luminance (L) is calculated from its red, green and blue values, weighted by how sensitive our eyes are to each: green counts most, blue least. The ratio is then (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter color. Ratios are rounded down, so a pair at 4.49:1 doesn't pass a 4.5:1 requirement.

    Advertisement

    Frequently asked questions

    What is a good contrast ratio?

    At least 4.5:1 for normal text and 3:1 for large text meets WCAG AA, the standard most sites follow. 7:1 or more is excellent and meets AAA.

    What is the contrast ratio of black on white?

    21:1, the highest possible.

    Does gray text on white pass WCAG?

    Only if it's dark enough. #767676 is the lightest gray that meets 4.5:1 on a white background; anything lighter fails for normal text.

    What counts as large text?

    Text at least 24px (18pt) in regular weight, or at least 18.66px (14pt) in bold.

    Do I need to check button and icon colors?

    Yes. Under WCAG 2.1, icons, form field borders and other important graphics need at least 3:1 contrast against what's next to them.

    More free color tools

    Advertisement