← All guides

    How to Check Color Contrast Against WCAG

    November 2026 · 9 min read · By Macrae Myint

    A color pair can look fine to the person who chose it and still be hard to read, especially as small body text, in sunlight, or for someone with low vision. WCAG 2 contrast ratio is the measure most teams and many regulations still use. The ToolsForge Color Tools page includes a contrast checker that uses the same relative-luminance formula, plus a set of shades you can click to find a passing color without guessing. Every ratio in the table below is computed by that same function at render time.

    The thresholds that matter

    • WCAG AA, normal text: at least 4.5:1. This is the usual bar for body copy, form labels, and navigation.
    • WCAG AA, large text: at least 3:1. "Large" here means 18 point or 14 point bold (roughly 24px regular, or 19px bold) and up.
    • WCAG AAA: 7:1 for normal text and 4.5:1 for large text. This is a stricter target, often used for long-form reading or public-sector work.
    • User-interface components and graphical objects: 3:1 against the adjacent background, so a button outline or an icon is actually visible.

    Contrast ratio runs from 1:1 (identical colors) to 21:1 (black on white, or the reverse). The formula is based on relative luminance, not on how "saturated" a color feels, which is why a vivid blue on white can fail even when it looks loud.

    A few real pairs

    ForegroundBackgroundRatioAA normalAA large
    #0F172A#FFFFFF17.85:1PassPass
    #808080#FFFFFF3.95:1FailPass
    #3B82F6#FFFFFF3.68:1FailPass
    #1D4ED8#FFFFFF6.70:1PassPass
    #3B82F6#0F172A4.85:1PassPass
    • #0F172A on #FFFFFF is 17.85:1. Near-black on white — typical body text.
    • #808080 on #FFFFFF is 3.95:1. Mid gray on white — looks soft, often fails AA for small type.
    • #3B82F6 on #FFFFFF is 3.68:1. A bright blue on white — common for links, often short of 4.5:1.
    • #1D4ED8 on #FFFFFF is 6.70:1. A darker blue on white — usually a safer link color.
    • #3B82F6 on #0F172A is 4.85:1. The same bright blue on dark slate — often easier than on white.

    Mid gray (#808080) on white is a frequent accident in placeholder text and captions. A brand blue that looks strong on a business card often lands just under 4.5:1 on a white page; darkening it, or placing it on a dark slate such as #0F172A, is usually enough. For reference, that bright blue against slate is 4.85:1.

    How to check a pair, and how to fix it

    1. Open Color Tools and enter the text color as HEX (3 or 6 digits), or pick it with the color picker.
    2. Enter the background color in the contrast checker and read the ratio against the thresholds above.
    3. If it fails, use the shades and tints row rather than guessing a new HEX value. Those swatches are the same hue and saturation at ten lightness steps, from 5% to 95%. Click a darker swatch for text on a light background, or a lighter swatch for text on a dark one, and check the ratio again.
    4. Copy the HEX, RGB, or HSL value you need. Recent colors are stored only in this browser's localStorage, and they never leave the device.

    The complementary, analogous, and triadic suggestions on the same page are for building a palette, not for meeting a contrast target. A complementary color is a 180° hue rotation: it can be a strong accent and still fail as body text. Always measure the pair you will actually use.

    Pairs people forget to measure

    Body text on the page background is only the first pair. Placeholder text in a form is often a mid gray that fails AA at small sizes. Disabled buttons are allowed to be weaker, but a control that is still clickable (a low-contrast link, a pale "secondary" button, a ghost button on a photo) is not disabled and should still meet the relevant threshold. Visited and hover link colors are separate pairs; if you change a link on hover, check both states. Text placed on a photograph or a gradient cannot be judged from one HEX value — contrast varies across the image. In that case, pick the lightest or busiest region the letters actually sit on, sample it, and measure against that, or put a solid scrim behind the text so the pair is under your control.

    Brand guidelines sometimes list a primary color that fails on white. That does not make the brand unusable; it means the primary color may be fine for large headings or buttons with a proven pair, and a darker shade should be used for small text and links. The shades row exists for that situation. Measure the shade you actually ship, not only the color on the brand sheet.

    Limits of this check

    WCAG 2 contrast is the compliance standard, and it is a simplified model. Newer perceptual methods such as APCA can disagree at the margins, especially for light text on a saturated background. The checker does not support 8-digit HEX with alpha, because contrast is not defined the same way for a transparent color; test the color as it will appear once it is composited onto a real background. This is also not a full accessibility audit: contrast is necessary, but focus order, text size, and keyboard access are separate problems.

    If you need a primer on what HEX, RGB, HSL, and CMYK actually store, the color formats guide uses the same converters.

    Related: Color Tools, HEX, RGB, HSL and CMYK explained.

    Check a color pair

    HEX, RGB, HSL, shades, palettes, and a WCAG contrast checker. All in your browser.

    Open Color Tools →