Color Contrast Checker

WCAG 2.1 AA/AAA ยท Hex, RGB, HSL input ยท Live preview

Colors

Accepts: #fff, #aabbcc, rgb(r,g,b), rgba(r,g,b,a), hsl(h,s%,l%)
Accepts: #fff, #aabbcc, rgb(r,g,b), rgba(r,g,b,a), hsl(h,s%,l%)
โ€”
Contrast Ratio
AA Normal
โ€”
โ‰ฅ 4.5:1
AA Large
โ€”
โ‰ฅ 3:1
AAA Normal
โ€”
โ‰ฅ 7:1
AAA Large
โ€”
โ‰ฅ 4.5:1

Live Preview

Heading text (large)
Body copy โ€” accessible text ensures everyone can read your content regardless of visual ability. Good contrast ratios matter for WCAG compliance.
Small text (12px) is harder to read โ€” aim for WCAG AA or higher.
Bold large text (18pt)
Button

WCAG 2.1 Contrast Requirements

LevelText SizeMin RatioNotes
AANormal text4.5:1Body text, UI labels, links
AALarge text3:1โ‰ฅ 18pt (24px) regular or โ‰ฅ 14pt (18.67px) bold
AAANormal text7:1Enhanced โ€” recommended for critical UI
AAALarge text4.5:1Enhanced large text
AANon-text (UI components)3:1Icons, focus rings, form borders

What is Color Contrast Checker?

Color Contrast Checker calculates the contrast ratio between two colors and reports whether the combination passes WCAG 2.1 accessibility standards at the AA and AAA levels. Enter foreground and background colors as hex codes, RGB values, or HSL values, and the tool instantly displays the contrast ratio and pass/fail status for normal text, large text, and UI components.

The Web Content Accessibility Guidelines (WCAG) define minimum contrast ratios to ensure text is readable for people with low vision or color deficiency. WCAG 2.1 Level AA (the legal baseline in many jurisdictions) requires 4.5:1 for normal text and 3:1 for large text (18pt+ or 14pt bold). Level AAA requires 7:1 for normal text and 4.5:1 for large text. The maximum possible contrast is 21:1 (black on white).

Contrast ratio is calculated from relative luminance โ€” a measure of how much light a color reflects. The formula is (L1 + 0.05) / (L2 + 0.05) where L1 is the lighter color's luminance. This is why blue text (#0000FF) on white (#FFFFFF) has a ratio of only 8.59:1, but blue on black (#000000) is just 2.44:1 โ€” despite blue "looking dark", its luminance relative to black is not far enough.

How to Use

  1. Enter your foreground (text) color in the first color picker or hex input field.
  2. Enter your background color in the second color picker or hex input field.
  3. Read the contrast ratio and the WCAG AA / AAA pass/fail badges.
  4. Use the 'Swap colors' button to check the inverse combination.
  5. Try the 'Suggest accessible alternatives' button to find nearby colors that pass.

Examples

White text (#FFFFFF) on blue (#0057B7)

Result: Contrast ratio: 4.58:1 โ€” Passes WCAG AA for normal text, fails AAA

Dark gray (#333333) on white (#FFFFFF)

Result: Contrast ratio: 12.63:1 โ€” Passes WCAG AA and AAA for all text sizes

Light gray (#CCCCCC) on white (#FFFFFF)

Result: Contrast ratio: 1.60:1 โ€” Fails WCAG AA โ€” a very common accessibility mistake

Frequently Asked Questions

What is WCAG and why does it matter?

WCAG (Web Content Accessibility Guidelines) is the international standard for web accessibility. Level AA compliance is legally required in many countries (ADA in the US, EN 301 549 in the EU). Poor contrast is one of the most common accessibility failures and affects ~300 million people with color vision deficiency.

What counts as 'large text'?

WCAG defines large text as 18pt (24px) or larger at normal weight, or 14pt (approximately 18.67px) or larger at bold weight. Large text has a lower contrast requirement (3:1 for AA) because it is easier to read at lower contrast.

Does contrast ratio apply to icons and UI components?

Yes. WCAG 1.4.11 (Non-text Contrast, Level AA) requires 3:1 contrast ratio for the visual presentation of UI components (buttons, inputs, icons that convey meaning) and focus indicators against their adjacent colors.

My brand colors don't pass โ€” what do I do?

Use your brand color for decorative elements, headlines, or large text where contrast requirements are lower. Switch to a darker or lighter shade that passes for body text. Tools like Leonardo Color or Accessible Palette generate entire color systems designed to meet contrast thresholds.

Does WCAG cover color-only distinctions?

Yes โ€” WCAG 1.4.1 says color alone must not be the only way to convey information. Links must be distinguishable from surrounding text by more than color (e.g., with underlines), and form errors must not be indicated by color alone.

Related Tools