Skip to content

WCAG Contrast Checker

Check text and UI colors against WCAG and fix them in one click.

Contrast checker

Colors

Auto-Fix

OKLCH lightness search
Target

Contrast ratio

——

AA · Normal text

1.4.3 · 4.5 : 1
—

AA · Large text

1.4.3 · 3 : 1
—

AAA · Normal text

1.4.6 · 7 : 1
—

AAA · Large text

1.4.6 · 4.5 : 1
—

UI components & graphics

1.4.11 · 3 : 1 · borders, icons, focus rings
—
APCA lightness contrast
—advisory, not a WCAG 2 requirement

    Live preview

    Small label · 11px mono

    Large text, 24px regular

    Large bold text, 18.66px weight 700

    Normal body text at 16px. Handmade ceramics are fired twice: once to harden the clay and again to fuse the glaze. Read the care guide before the first wash.

    Small print at 13px, the size of captions, footnotes and helper text.

    Field guide for designers & makers

    Readable color: a practical guide to WCAG contrast

    Low contrast is the most common accessibility failure on the web, and the easiest to fix. One in twelve men has some form of color vision deficiency, and everyone loses contrast sensitivity with age, glare and cheap screens. A pairing that passes is a pairing more people can read.

    01How the contrast ratio is calculated

    WCAG compares the relative luminance of the two colors: how bright each one appears, weighted for the eye’s sensitivity to green over red and blue. Each sRGB channel is first converted to linear light:

    c = channel / 255
    linear = c ≤ 0.04045 ? 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)

    The result runs from 1:1 (identical colors) to 21:1 (black on white). The 0.05 term models ambient light flare on a screen. The ratio is symmetric, so swapping text and background gives the same number, although it rarely looks the same.

    Never round up. A ratio of 4.499:1 fails the 4.5:1 requirement. This tool truncates to two decimals so a borderline pair never displays as a pass.

    02AA, AAA and what each level covers

    ContentAAAAACriterion
    Normal text4.5 : 17 : 11.4.3 / 1.4.6
    Large text3 : 14.5 : 11.4.3 / 1.4.6
    UI components, focus indicators, icons, chart lines3 : 1—1.4.11
    Logos, disabled controls, decorationExemptExempt—

    AA is the level referenced by most accessibility laws and procurement rules, including the ADA guidance in the US, the European Accessibility Act through EN 301 549, and Section 508. AAA is not required for whole sites, but it is a good target for long-form reading such as articles, product descriptions and documentation.

    03Large text and interface components

    Large text is 18pt (24px) at regular weight or 14pt (about 18.66px) at bold. Bigger strokes are easier to read, so the requirement drops to 3:1. Be careful with thin weights: a 24px light weight renders like much smaller text and deserves the normal-text threshold.

    Success Criterion 1.4.11 covers the parts of an interface people need to see to operate it:

    • Input borders must reach 3:1 against the page if the border is the only thing showing where the field is.
    • Focus indicators need 3:1 against the surrounding colors so keyboard users can find their place.
    • Icons that carry meaning, such as a search glass or a cart, and the lines of a chart need 3:1 against their background.
    • Button fills don’t have to contrast with the page if the button’s text label identifies it, but the label must still reach 4.5:1 against the fill.

    04APCA, explained

    The WCAG 2 formula treats contrast as symmetric and overstates the contrast of dark pairs: mid-grey text on black can pass at 4.5:1 and still be hard to read. The Accessible Perceptual Contrast Algorithm fixes both: it models light-on-dark and dark-on-light separately and returns a lightness contrast value Lc from about 0 to 106 for dark text, and from 0 to −108 for light text.

    |Lc|Rough use
    90Preferred for body text and long reading
    75Minimum for body text (about 18px regular or 14px bold)
    60Content text that isn’t body copy (about 24px regular or 16px bold)
    45Headlines and large text (about 36px regular or 24px bold)
    30Minimum for placeholder text, disabled-looking text and meaningful non-text elements
    15Dividers and decorative elements; below this, things start to disappear

    APCA was explored for WCAG 3, but the current WCAG 3 working draft lists its contrast method as still to be decided, and no law requires APCA. Treat the reading as a second opinion: if a pair passes WCAG 2 but scores a low Lc, especially in a dark theme, it is worth making stronger.

    05Fixing a failing pair without losing the palette

    Lightening or darkening in HSL often shifts the hue and makes a brand color look dirty. Auto-Fix works in OKLCH, a perceptual color space in which lightness can change while the hue and colorfulness stay put:

    1. Convert the color to OKLCH and hold its hue and chroma.
    2. Search lightness in both directions, darker and lighter, using binary search until the rounded hex value reaches the target.
    3. If the new lightness pushes the color outside the sRGB range, reduce chroma just enough to bring it back.
    4. Rank every option by its OKLab difference (ΔE) from the original and recommend the smallest change.

    Usually the text color should move and the background should stay, because backgrounds carry the layout. When a brand color fails as text, keep it for large headings, icons or accents where 3:1 is enough, and use a darker shade for body links.

    06Beyond the number

    • Never use color alone to signal state (1.4.1). Pair a red error border with an icon or message, and underline links inside body text.
    • Check every state. Hover, focus, visited and selected colors each need to pass on their own.
    • Check text on images against the lightest and darkest part of the image behind it, or add a solid or gradient scrim.
    • Test dark mode separately. A palette that passes in light mode can fail when surfaces turn dark, and APCA is particularly useful there.
    • Simulate color blindness. Red and green pairs that look distinct to you may share the same lightness, and the vision toggle above shows how they collapse.

    To build a palette from a photo or artwork first, start with the Color Palette Extractor, then test the pairings here.

    Questions

    Frequently asked

    01What contrast ratio do I need to pass WCAG AA?

    WCAG 2.1 and 2.2 Level AA require 4.5:1 for normal text and 3:1 for large text (Success Criterion 1.4.3), and 3:1 for user interface components and meaningful graphics such as input borders, focus indicators and icons (1.4.11). Level AAA raises text to 7:1, or 4.5:1 for large text (1.4.6). The ratio must meet the threshold exactly: 4.49:1 fails AA, because the specification does not allow rounding up.

    02What counts as large text?

    WCAG defines large text as at least 18 point, or at least 14 point if bold. On the web that is roughly 24 CSS pixels at regular weight, or 18.66 CSS pixels at weight 700. Text that is only large because the user zoomed in does not count, and thin or decorative fonts may need more contrast than the size suggests.

    03What is APCA, and should I use it instead of WCAG?

    APCA (Accessible Perceptual Contrast Algorithm) models how contrast is perceived more closely than the WCAG 2 ratio: it treats dark text on light backgrounds differently from light text on dark backgrounds and accounts for font size and weight. It was explored for WCAG 3 but is not in the current WCAG 3 draft, and no law or procurement standard requires it. Use the WCAG 2 result for compliance and treat the APCA reading as a second opinion, especially for dark themes.

    04Do placeholder text, disabled buttons and logos need to meet contrast?

    Text in disabled (inactive) controls, purely decorative text and logotypes are exempt from the contrast criteria. Placeholder text is not on that list, so most audits treat it as text that needs 4.5:1. Because placeholder text that passes can be mistaken for an entered value, a visible label above the field is the better pattern.

    05How does Auto-Fix choose the new color?

    Auto-Fix keeps the hue and saturation of your color and moves only its perceived lightness in the OKLCH color space, searching for the smallest change that reaches the target ratio once the result is rounded to a real hex value. It tries both a darker and a lighter version of the text color and of the background, measures each change with the OKLab color difference (ΔE), and recommends the least noticeable one.

    Keyboard shortcuts

    Swap text and backgroundX
    Apply the best Auto-FixF
    Auto-Fix target: 3, 4.5, 71–3
    Next sample pairingS
    Cycle color vision simulationV
    Copy CSS / share linkC L
    Undo the last changeU
    This panel?