Skip to content

Runs entirely in your browser. Nothing you paste leaves this page.

Free / No sign-up

Color contrast checker for WCAG AA and AAA.

Check text and background colours against WCAG 2.2 contrast requirements, preview them live, and get the nearest shade that passes AA or AAA.

Contrast ratio

2.39:1

  • AA normal text (4.5:1)Fail
  • AA large text (3:1)Fail
  • AAA normal text (7:1)Fail
  • AAA large text (4.5:1)Fail
  • UI components and graphics (3:1)Fail

Live preview

Large text, 24px bold

Normal body text at 16px. Readable contrast helps everyone, including people with low vision and anyone reading a phone in sunlight.

Outlined button

Suggested fixes

  • AA 4.5:1#296BFF
  • AAA 7:1#0046E3

WCAG 2.x ratios (success criteria 1.4.3, 1.4.6 and 1.4.11). Large text means at least 24px regular or about 18.66px bold. Suggestions keep the hue and move lightness toward black or white.

How to use it.

  1. 01

    Pick or type a text colour and a background colour in hex, or press Swap to flip them.

  2. 02

    Read the ratio and the AA and AAA results for normal text, large text and UI components, and check the live preview.

  3. 03

    If a level fails, press Use on a suggested shade to make the pair pass while keeping your hue.

What it does.

Everything this tool handles, all of it inside your browser tab.

  • WCAG 2.x contrast ratio from 1:1 to 21:1
  • Pass or fail for AA and AAA, normal and large text
  • Non-text contrast check at 3:1 for UI components and graphics (SC 1.4.11)
  • Live preview with large text, body text, an outlined button and icons
  • Colour pickers and hex input (3 or 6 digits), with a swap button
  • Nearest passing shade for AA and AAA that keeps your hue and saturation
  • Ratios truncated, never rounded up, so borderline pairs are not over-reported
  • Runs entirely in your browser

Worked examples.

  • Check a light brand blue on white

    #7EA6FF on #FFFFFF → 2.39:1
    AA normal (4.5:1)  Fail
    AA large  (3:1)    Fail
    UI parts  (3:1)    Fail
    Nearest AA shade:  #296BFF
    Nearest AAA shade: #0046E3

    The suggestions keep the same hue and saturation and only darken the colour until it reaches 4.5:1 or 7:1.

  • The lightest grey that passes AA on white

    #767676 on #FFFFFF → 4.54:1   AA normal text: Pass
    #777777 on #FFFFFF → 4.47:1   AA normal text: Fail

    One step of lightness separates pass from fail, and 4.47 is not rounded up to 4.5.

  • Grey for AAA body text

    #595959 on #FFFFFF → 7.00:1   AAA normal text: Pass

    #595959 is the lightest neutral grey that reaches 7:1 on pure white; #5A5A5A drops to 6.89:1.

  • White text on a blue button

    #FFFFFF on #1F5EFF → 5.11:1
    AA normal text: Pass
    AAA normal text: Fail (needs 7:1)

    Common for primary buttons. It meets AA; for AAA, darken the button rather than the text.

  • How the contrast ratio is calculated

    channel c = value / 255
    linear = c ≤ 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ^ 2.4
    L = 0.2126 × R + 0.7152 × G + 0.0722 × B
    ratio = (L_lighter + 0.05) / (L_darker + 0.05)
    
    black on white: (1 + 0.05) / (0 + 0.05) = 21:1

    This is the WCAG 2.x definition this checker implements. The 0.05 term accounts for screen flare and stops dark pairs dividing by zero.

What is a color contrast ratio?

Contrast ratio is the measure WCAG uses to decide whether text stands out enough from its background to be read by people with low vision or colour-vision deficiencies, on dim screens and in bright sunlight. It runs from 1:1, where the colours are identical, to 21:1, black on white.

The ratio compares relative luminance, the perceived brightness of each colour. Each sRGB channel is converted from 0 to 255 into a linear value, then weighted by how sensitive the eye is to it: L = 0.2126 R + 0.7152 G + 0.0722 B. Green dominates, which is why yellow looks bright and blue looks dark at the same saturation. The ratio is (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter colour. Hue does not enter the formula, so red text on a green background of the same luminance scores close to 1:1 however different they look.

WCAG contrast requirements: AA, AAA and UI components

WCAG 2.2, the current W3C recommendation, keeps the same contrast rules as WCAG 2.0 and 2.1. Success criterion 1.4.3 (level AA) requires 4.5:1 for normal text and 3:1 for large text. Success criterion 1.4.6 (level AAA) raises those to 7:1 and 4.5:1. Large text means at least 18 point (24 CSS pixels) or 14 point bold (about 18.66 CSS pixels).

Success criterion 1.4.11, Non-text Contrast (AA), asks for 3:1 between user-interface parts and their surroundings: input borders, checkboxes, focus indicators, icons that carry meaning and the lines and segments of charts. The UI row above tests exactly this.

Some things are exempt: logos and brand names, purely decorative content, text in pictures that are incidental, and disabled controls. Exempt does not mean ignored: a faint disabled button still needs to be recognisable as a button.

Does 4.49:1 pass? Why ratios are never rounded

No. WCAG thresholds are exact, so 4.49:1 fails AA even though it rounds to 4.5. This checker truncates the displayed ratio to two decimals instead of rounding, and tests pass or fail against the exact value, so a borderline pair is never reported as passing when it does not.

The classic example is grey text on white. #767676 gives 4.54:1 and passes AA, the lightest neutral grey that does. #777777, one step lighter, gives 4.47:1 and fails. If your design sits within a few hundredths of a threshold, choose the next darker shade so small rendering differences cannot tip it over.

How to fix a failing color without losing your brand

The suggestions here keep your colour's hue and saturation and move only its lightness, toward black on light backgrounds or toward white on dark ones, until the pair reaches 4.5:1 for AA or 7:1 for AAA. The result is the closest passing shade, so it still reads as your brand colour.

Mid-tone brand colours, especially light blues, oranges, yellows and greens, often score 2:1 to 4:1 on white. A robust pattern is to keep the vivid shade for large headings, illustrations and backgrounds, and use a darker shade from the same family for body text and links. Build both into your design system as named tokens, such as brand-500 for fills and brand-700 for text, so nobody has to recheck contrast for every new screen.

WCAG 2 vs APCA: what is changing?

The WCAG 2 formula is simple and widely adopted, but it is known to misjudge some pairs. It tends to overstate contrast between dark colours and can rate white text on saturated mid-tones, such as orange, lower than many readers perceive it.

APCA, the Accessible Perceptual Contrast Algorithm, was developed to address this. It is polarity-aware, so dark-on-light and light-on-dark score differently, and it takes font size and weight into account, reporting a lightness contrast value (Lc) instead of a ratio. APCA was explored for WCAG 3, but WCAG 3 is still a working draft and its current draft does not settle on a contrast method. APCA is not a conformance requirement anywhere today.

For compliance, use the WCAG 2.x ratio, which is what this checker computes. It is fine to use APCA as an extra design check, as long as your colours still pass WCAG 2.2.

Who requires WCAG color contrast?

Accessibility laws and standards in many regions point to WCAG 2.x level AA, which includes the 4.5:1 and 3:1 contrast rules. Examples include Section 508 for US federal technology, EN 301 549, the standard behind the European Accessibility Act that has applied to many products and services sold in the EU since June 2025, the UK's public sector accessibility regulations, and India's GIGW guidelines for government websites. Courts and regulators elsewhere use WCAG as the benchmark too.

Contrast is one of the most common failures in automated audits, and one of the cheapest to fix early. Our WCAG 2.2 accessibility testing checklist covers the rest of an audit, and the web accessibility glossary entry explains the principles behind it.

Checking contrast in real interfaces

Text over images or gradients: test the lightest and darkest areas the text can sit on, and add an overlay or text shadow if any area fails. Semi-transparent colours: blend the colour over its actual background first and test the resulting solid colour, since this checker takes opaque hex values. Dark mode: check every pair again in the dark theme, because a colour that passes on white rarely passes on near-black unchanged.

Do not forget states. Hover, focus, visited links, placeholder text, error messages and selected tabs are all text or UI that someone needs to read. WCAG 2.2 also added Focus Appearance (2.4.13, AAA), which asks for a focus indicator with 3:1 contrast between its focused and unfocused states.

Questions, answered

Something else on your mind? Ask a consultant and get a reply within one business day.

What contrast ratio do I need for WCAG AA?

4.5:1 for normal text and 3:1 for large text and for UI components such as input borders and icons. For AAA, normal text needs 7:1 and large text 4.5:1.

What counts as large text in WCAG?

Text of at least 18 point, which is 24 CSS pixels, or at least 14 point bold, about 18.66 CSS pixels. Anything smaller is normal text and needs the higher ratio.

Does a contrast ratio of 4.49:1 pass?

No. WCAG thresholds are exact and are not rounded, so 4.49:1 fails AA. This checker truncates the displayed ratio for that reason.

Did WCAG 2.2 change the contrast requirements?

No. WCAG 2.2 kept success criteria 1.4.3, 1.4.6 and 1.4.11 exactly as in 2.1. It added new criteria elsewhere, including Focus Appearance at AAA.

Does this follow WCAG 2.2 or APCA?

It uses the WCAG 2.x formula, which is what WCAG 2.2 and accessibility laws require today. APCA was explored for WCAG 3, which is still a draft, and it is not a conformance requirement.

Why does my brand colour fail?

Mid-tone colours such as light blues, oranges and greens often score between 2:1 and 4:1 on white. Use them for large text, fills behind white text or decoration, and a darker shade for body text.

Should I use white or black text on a coloured background?

Test both here with Swap and pick the higher ratio. On many saturated mid-tones, such as orange or bright green, black text passes AA where white does not.

How do I check contrast for text on an image or gradient?

Sample the lightest and darkest colours behind the text and test each one. If any fails, add a solid or semi-opaque overlay, or move the text to a calmer area.

Do logos and disabled buttons need to pass?

No. WCAG exempts logos and brand names, purely decorative content and inactive user-interface components from contrast requirements. Disabled controls should still be recognisable.

Does it support transparent or RGB colours?

It takes opaque hex colours, in 3- or 6-digit form, plus the colour pickers. For a semi-transparent colour, blend it over its background first and test the resulting hex value.

More free tools.

All tools

Need tooling like this inside your product?

We build internal tools, developer platforms and APIs. Tell us what your team keeps doing by hand.