Skip to content

Color contrast checker. WCAG AA and AAA.

Browser-only · nothing leaves this device
§ 01 · brand preset
§ 02 · inputs

Foreground + background.

§ 02b · preview
Large headline text
Normal body copy. The five boxing wizards jump quickly. Contrast matters at 16px.
caption / small, 12px
§ 03 · results

Ratio + verdicts.

contrast ratio
-
-
normal text · AA
target 4.5:1
-
normal text · AAA
target 7:1
-
large text · AA
target 3:1
-
large text · AAA
target 4.5:1
-
UI components
target 3:1
-
§ · written guide

How to use the Color Contrast Checker

This checker measures the contrast between a text color and a background color with the WCAG 2.1 relative luminance formula. It shows the ratio, from 1:1 for identical colors up to 21:1 for black on white, and a pass or fail for each WCAG level. Use it to test brand colors, buttons and body text before they go live.

Step by step

  1. Try a preset (optional)

    Press DH moss on cream, Black on white, Muted sage pass or Muted sage fail to load a sample pair. They run from the 21:1 maximum of black on white down to 2.57:1 for the sage that fails.

  2. Set the text color

    Under Foreground (text), click the swatch to open your browser's color picker, or type a hex code in the box beside it. The default is #0f1713, a near black green.

  3. Set the background color

    Do the same under Background. The default is #f5f0e8, a warm cream. The swatch and the hex box stay in step, and the results update as you type.

  4. Check the preview

    The preview card shows a large headline, a 16px paragraph and a 12px caption in your two colors, so you can judge the pair by eye as well as by the number.

  5. Copy the report

    Press Copy results to clipboard to copy both hex codes, the ratio and a pass or fail line for each of the five checks, ready to paste into a ticket or a design review.

Reading the result

  • The big number is the contrast ratio. The defaults, #0f1713 on #f5f0e8, give 16.07:1. It shows green at 7:1 or more, amber from 4.5:1 and red below 4.5:1.
  • The label under the ratio sums it up: Excellent, passes AAA from 7:1; Good, passes AA from 4.5:1; Limited, large text only from 3:1; and Failing, rework colors below 3:1.
  • Five rows test each WCAG target: normal text AA at 4.5:1, normal text AAA at 7:1, large text AA at 3:1, large text AAA at 4.5:1 and UI components at 3:1.
  • A failing row says how far short the ratio is. With Muted sage fail at 2.57:1, normal text AA reads fail with +1.93 short.
  • Large text means 18 point regular or 14 point bold and up, roughly 24px or 18.66px. Body copy at 16 to 18px regular needs the normal text targets.

Tips and common mistakes

  • Type the full six digit hex code with the # sign. Short codes like #fff and color names are not read, and the results stay on the last valid pair until the code is complete.
  • Swapping the two colors does not change the ratio, but keep the text color in Foreground (text) so the preview looks right.
  • If a brand color fails, keep it for large headings, icons or backgrounds and use a darker or lighter version of it for body text.
  • Check every state you ship, such as hover, disabled and placeholder text, not only the default.
  • The checker compares two solid colors. For text over a photo or a gradient, test it against the lightest and the darkest part behind the text.

Privacy and limits

The ratio is worked out in your browser with the WCAG formula. Nothing is sent to a server and nothing is saved, so reloading the page brings back the default colors. The copy button needs clipboard access on this page.

Back to the tool

§ 04 · the luminance formula

Contrast is luminance math.

WCAG contrast is a ratio between the relative luminance of two colors, computed per the published sRGB formula. Ratios range from 1:1 (identical colors) to 21:1 (pure black on pure white). The thresholds are 4.5:1 for normal body text at level AA, 3:1 for large text and UI components, and 7:1 for AAA normal text. These thresholds map to empirical research on users with 20/40 vision and below; below 4.5:1, body copy becomes unreliable for a meaningful slice of the audience.

Three common failure modes. First, muted pastel brand primaries on white, most sage greens, dusty rose, and warm grays sit at 3:1 to 4:1 and fail body copy. Second, amber/orange on white, warm colors have low luminance contrast despite looking bright. Third, gray-on-gray UI hierarchies, text-gray-400 on bg-gray-50 often measures 3.2:1 and fails AA.

The fix is a tonal system, not a color swap. Keep the brand color for brand moments; define a darker "text-safe" variant for body copy. Every mature design system, Tailwind's palette, Material 3, IBM Carbon, ships with a named text-on-brand variant that clears AA. The earthy palette contrast table shows why walnut on cream passes AAA at 11.09:1 while moss on cream fails for text at 2.57:1.

Tools in the same cluster: Website Audit for the full Lighthouse accessibility score. Heading Outliner for the heading-order compliance check.

§ 05 · questions

Five answers.

What is a WCAG-compliant contrast ratio?

WCAG 2.1 level AA requires 4.5:1 for normal text and 3:1 for large text (18pt regular or 14pt bold and up) and for non-text UI components (icons, form borders). Level AAA raises normal text to 7:1 and large text to 4.5:1. Most DTC brands target AA as the floor and AAA where feasible. Below 4.5:1 on body copy, users with moderate low vision or sun glare on mobile screens cannot read reliably.

What counts as 'large text' for the 3:1 threshold?

Large text per WCAG is 18 point or 14 point bold and above, measured in CSS pixels roughly as 24px and 18.66px. In practice that means display headlines, hero titles, and any bold subheading at 19px and up qualifies. Body paragraphs at 16 to 18px regular weight do not. When in doubt, use the stricter 4.5:1 threshold for all text.

Does the 3:1 threshold apply to every UI element?

It applies to UI components that convey meaning through color: form-field borders against page background, icons, focus outlines, chart colors, and state indicators (active vs. inactive tab). Decorative elements (a background pattern, a divider line that is redundant with white space) are exempt. Anything that a user needs to perceive to operate the interface must clear 3:1 against its adjacent color.

Why is my brand color failing contrast?

Most brand primary colors in the 2018-2024 'muted' trend (sage greens, dusty pinks, warm grays) sit near the middle of the luminosity curve and fail the 4.5:1 threshold against both white and black. The fix is a tonal system: keep the brand color for brand moments (hero backgrounds, icons at large size), use a darker or lighter variant for text that needs to pass. Every modern design system does this; the brand book names the text-safe variant explicitly.

Does this tool save my data?

No. Every value you enter lives in memory for this browser tab only. Nothing is transmitted to a server, stored in a database, or synced. Close the tab and the data is gone. The Copy Results button puts a plain-text summary on your clipboard.

§ 06 · accessible brand system

Brand color failing AA?

Our UI/UX engagements rebuild brand palettes into token systems with text-safe variants, dark-mode pairs, and WCAG-audited state indicators. Written in 2 weeks, implementation over 4-6.

Published · Last updated .

Priya sent you a message Online now

Talk to a Developer Now

Share your name and email to reply.

Reply