Start a project

Tool 43 of 244 · Accessibility

Contrast Checker

Check any text and background colour against WCAG 2.2, see the nearest colour that passes if it doesn't, and turn a brand colour into an accessible palette.

Contrast Checker at a glanceIllustration: 1, Two colours; 2, processed in your browser; 3, Ratio + WCAG grade.Contrast CheckerAa 4.5:11Two colours3Ratio + WCAG grade2In yourbrowser
1 Two colours 2 processed on your device 3 Ratio + WCAG grade

Contrast Checker

Your colours

Hex, rgb(), hsl() or a colour name
Hex, rgb(), hsl() or a colour name

Body text at 16px. Can everyone read this comfortably?

Large text at 24px

Button

Contrast ratio

–

    APCA Lc ·

    Nearest passing text colour

    Accessible palette builder

    Turn one brand colour into 11 shades, with each shade's contrast as text on white and on black, and which text colour reads best on it.

    Hex, rgb(), hsl() or a colour name
    Used in the CSS variable names
    ShadeHexOn whiteOn blackText on it
    CSS variables
    JSON

    01

    What it does

    WCAG 2.2 AA and AAA checks, APCA, the nearest colour that passes, and an accessible palette from one brand colour.

    • WCAG 2.2 contrast ratio with AA and AAA results for normal text, large text and UI
    • APCA Lc as a second opinion
    • Nearest passing colour, keeping the same hue
    • 11-shade palette with contrast on white and black

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    CSS variables and JSON, with a Copy and a Download button on every result.

    • WCAG 2.2
    • APCA
    • OKLCH
    • CSS variables

    Why it matters

    About one in twelve men and one in two hundred women have some form of colour vision deficiency, and many more people read screens in bright sunlight or with tired eyes. Low-contrast text is the most common accessibility failure on the web: WebAIM's yearly review of the top million home pages finds it on most of them.

    WCAG 2.2, the standard UK public sector sites must meet and the one most accessibility audits use, asks for a contrast ratio of at least 4.5:1 for body text and 3:1 for large text and interface parts such as input borders and icons (level AA). The problem is that a brand colour that fails usually only needs a small nudge, and finding that nudge by hand is slow. This tool finds it for you, keeping the same hue so it still looks like your brand.

    How it works

    1. InputText and background colours (hex, RGB or OKLCH)
    2. In your browserRelative luminance → contrast ratio, plus APCA
    3. OutputPass/fail for AA and AAA, and a nearest passing colour

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Use it while picking brand colours, then again in testing for every text and button colour.

    By the numbers

    Contrast ratio of grey text on white against the WCAG thresholds#aaaaaa text on white: 2.32:1; #949494 text on white: 3.03:1; #777777 text on white: 4.48:1; #767676 text on white: 4.54:1; #595959 text on white: 7.0:1; #000000 text on white: 21.0:134.57#aaaaaa text on white2.32:1#949494 text on white3.03:1#777777 text on white4.48:1#767676 text on white4.54:1#595959 text on white7.0:1#000000 text on white21.0:1
    Computed with the WCAG relative-luminance formula, the same maths the checker uses. Lines mark 3:1 (large text and UI parts, AA), 4.5:1 (body text, AA) and 7:1 (body text, AAA). #777777 just misses AA; #767676 is the lightest grey that passes. Source: WCAG 2.2 SC 1.4.3, 1.4.6, 1.4.11.
    Show the numbers as a table
    Text colour on #ffffffRatioBody text AA (4.5)AAA (7)
    #aaaaaa2.32:1FailFail
    #9494943.03:1FailFail
    #7777774.48:1FailFail
    #7676764.54:1PassFail
    #5959597.0:1PassPass
    #00000021.0:1PassPass

    How to use it

    1. Type or pick your text colour and background colour. Hex, rgb(), hsl() and colour names all work.
    2. Read the ratio and the five results. Body text needs AA normal; headings 24px and up need AA large.
    3. If it fails, press Use next to the suggested colour to swap it in.
    4. For a full palette, enter your brand colour below and copy or download the CSS variables.

    FAQ

    Why does #777777 on white fail?

    Its contrast ratio is 4.48:1, just under the 4.5:1 that WCAG AA asks for body text. #767676 is the lightest grey that passes on white, at 4.54:1.

    What is APCA?

    The Accessible Perceptual Contrast Algorithm, the method being developed for WCAG 3. It accounts for which colour is the text and how thin fonts are. It isn't a legal standard yet, so use the WCAG 2.2 results for compliance and APCA as a second opinion.

    What counts as large text?

    24px and up, or 18.66px and up if it's bold (that's 18pt and 14pt bold in the standard's terms).

    Is anything I enter sent anywhere?

    No. All the maths runs in your browser, so it keeps working offline once the page has loaded.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk