Color Contrast Checker
rgb(30, 41, 59)
rgb(248, 250, 252)
13.98:1
Contrast Ratio
✓ Passes WCAG AAA
WCAG 2.1 Compliance
Normal textAA · < 18pt / < 14pt bold
4.5:1PASS
Normal textAAA · < 18pt / < 14pt bold
7:1PASS
Large textAA · ≥ 18pt or ≥ 14pt bold
3:1PASS
Large textAAA · ≥ 18pt or ≥ 14pt bold
4.5:1PASS
UI componentsAA · icons, borders, inputs
3:1PASS
Presets

The quick brown fox jumps over the lazy dog.

Normal text — 16px (12pt). This is how body copy, paragraphs, labels, and most interface text appears at typical reading size.

Bold text at normal size looks like this.

Foreground luminance0.0218
Background luminance0.9536
🔖
Bookmark this page
Press Ctrl+D to save this tool in your browser for instant access anytime — no sign-up needed.

Color Contrast Checker — Free WCAG AA & AAA Accessibility Tool

Share

About this tool

Free Color Contrast Checker — WCAG 2.1 AA & AAA Compliance for Web Accessibility

Pick two colors and instantly see whether they pass WCAG 2.1 accessibility requirements. The contrast ratio is calculated in real time using the official WCAG relative luminance formula — the same algorithm used by every major accessibility testing tool including axe, WAVE, Lighthouse, and Colour Contrast Analyser.

The results panel shows a pass/fail breakdown across all five WCAG 2.1 criteria: AA Normal text (4.5:1), AAA Normal text (7:1), AA Large text (3:1), AAA Large text (4.5:1), and AA UI components (3:1 for borders, icons, and interactive elements). Most organizations target Level AA as their minimum standard. Level AAA is required for specialized accessibility contexts.

The Preview panel shows your colors applied to real content in three modes: Normal text (16px body copy and bold), Large text (24px heading and 19px bold heading), and UI components (buttons, outlined buttons, input fields, checkboxes, and icon glyphs). This lets you judge how the combination reads visually — because a passing ratio doesn't always mean the design feels comfortable, and a failing ratio might still be acceptable for large decorative headings.

If your color combination fails AA, the tool suggests an adjusted foreground color that meets the 4.5:1 minimum. The suggestion is calculated by nudging the foreground RGB values toward black or white until the threshold is reached, preserving the hue direction as much as possible. Click Use to apply it instantly.

The luminance values are shown for both colors — useful when you need to understand why a color fails and want to make an informed adjustment. Luminance is the foundation of the contrast formula: it tells you how bright each color appears to the human eye.

All calculation runs in your browser using JavaScript. No color data is sent to any server.

Features

  • Contrast ratio calculation using the WCAG 2.1 relative luminance formula — the same algorithm used by Lighthouse, axe, and WAVE accessibility auditors
  • Five WCAG criteria checked simultaneously — AA Normal (4.5:1), AAA Normal (7:1), AA Large (3:1), AAA Large (4.5:1), AA UI components (3:1)
  • Live preview in three modes — Normal text (body copy, bold), Large text (headings), and UI components (buttons, inputs, checkboxes, icons)
  • Suggested fix — when AA fails, the tool calculates and displays a nudged foreground color that meets 4.5:1, with a one-click "Use" button
  • Luminance display — shows the relative luminance of each color (0–1 scale) to help you understand why a color pair passes or fails
  • Color picker + hex input per color — use the native browser color picker for visual selection or type hex codes directly; both sync in real time
  • RGB display — shows the rgb() equivalent of each color for reference and CSS use
  • Swap button — reverses foreground and background with one click to instantly see the inverse combination
  • Six accessible presets — load curated color pairs to explore passing and failing examples
  • 100% browser-based — all WCAG calculations run client-side using JavaScript; no colors are sent to any server

How to Use

Enter your foreground (text) color in the top hex field, either by clicking the color swatch to open the native color picker or by typing a hex code directly. Enter your background color in the bottom hex field the same way. The contrast ratio badge updates instantly, showing the ratio and whether it passes or fails WCAG AA overall. Scroll the WCAG 2.1 Compliance table to see pass/fail for each individual criterion with the required minimum ratio. Use the Preview tabs on the right to see Normal text, Large text, or UI component previews rendered in your exact colors. If the combination fails AA, a suggestion box appears with an adjusted foreground color — click Use to apply it. Use the Swap button (⇅) between the two fields to reverse foreground and background. Click any preset in the Presets grid to load a pre-built color pair.

Common Use Cases

🎨
Check brand color combinations meet WCAG AA before shipping
Paste your primary brand color as the foreground and the page background as the background. Check whether it passes 4.5:1 for body copy. If it fails, use the suggested fix to find the closest dark variant that passes — then update your design tokens or CSS variables with the new value. Run this check for every text/background combination in your design system: primary on white, white on primary, gray on white, and any colored card backgrounds. Use our Color Palette Generator to build an accessible full palette.
Audit website text colors for WCAG 2.1 AA compliance
Pick the text color and background from your website using the browser eyedropper (available in Chrome and Firefox DevTools color picker). Paste the hex values here to verify each text/background pair passes 4.5:1 AA. Common failure areas: gray body text on white (#6b7280 on #ffffff is only 4.48:1 — barely failing), placeholder text in forms, footer text on dark backgrounds, and link color on colored button backgrounds. For a full site audit, check every unique text-background combination in your stylesheet.
📱
Design accessible UI components — buttons, inputs, and icons
Switch to the UI preview tab to see how your color pair applies to interactive components. WCAG 2.1 Success Criterion 1.4.11 (Non-text Contrast) requires 3:1 for UI component borders and states — this includes the border of a text input, the checked state of a checkbox, the outline of a focused button, and icons that carry meaning. Test your button border color against the page background, and your icon color against its container background.
🖨
Check color contrast for print and document accessibility
PDF documents and printed materials also need to meet contrast requirements for accessibility compliance under ADA and Section 508 in the US and EN 301 549 in Europe. Use this checker to verify heading and body text colors in document templates against their page backgrounds. Gray on white is a common failure in corporate report templates. For documents that will be printed in grayscale, test your text colors against a white background — what reads as a branded teal on screen may become a near-invisible light gray in print.
🌙
Verify dark mode color contrast separately from light mode
Dark mode designs require separate contrast checks — a text color that passes on white may fail dramatically on a dark background. Check your dark mode palette: white text on dark backgrounds usually passes easily, but secondary text colors (muted grays) on dark surfaces often fail. Use the Swap button to quickly reverse a color pair and compare light vs dark mode contrast ratios side by side. Combine with our Color Palette Generator to build dark-mode-ready token sets.
📊
Validate data visualization colors for accessibility
Charts, graphs, and infographics must meet 3:1 non-text contrast for any graphical elements that convey information — bar fills, line colors, legend swatches, and axis labels. Check each data series color against the chart background. Red and green combinations are especially problematic — they may fail contrast AND be indistinguishable for users with red-green color blindness (deuteranopia affects ~8% of men). Use high-contrast alternatives like blue and orange, which both meet contrast requirements and are distinguishable for most types of color vision deficiency.

Frequently Asked Questions

Color contrast ratio measures the difference in perceived brightness between two colors — typically a foreground (text) color and a background color. It is calculated using the WCAG relative luminance formula: contrast ratio = (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 is the relative luminance of the darker color. Relative luminance converts each RGB channel to a linear value using a gamma correction formula, then combines them as 0.2126×R + 0.7152×G + 0.0722×B. The resulting ratio ranges from 1:1 (no contrast — identical colors) to 21:1 (maximum contrast — pure black on pure white).

WCAG 2.1 Level AA requires a contrast ratio of at least 4.5:1 for normal text (smaller than 18pt or 14pt bold) and at least 3:1 for large text (18pt and above, or 14pt bold and above). For UI components such as form input borders, focus indicators, and icons that convey information, WCAG AA also requires at least 3:1 contrast against adjacent colors. These requirements apply to text and interactive elements — purely decorative images and disabled controls are exempt.

WCAG 2.1 Level AAA requires a contrast ratio of at least 7:1 for normal text and at least 4.5:1 for large text (18pt or 14pt bold). AAA is the highest level of WCAG conformance. It is intended for specialized accessibility use cases — most organizations target AA compliance as the standard for production websites. AAA compliance for all text is often impractical because very high contrast can reduce legibility for people with certain cognitive disabilities, and many brand color palettes cannot meet 7:1 throughout.

Enter your foreground (text) color and background color using the hex input fields or color pickers. The contrast ratio is calculated instantly. The WCAG 2.1 Compliance table shows pass or fail for all five key criteria: AA Normal text (4.5:1), AAA Normal text (7:1), AA Large text (3:1), AAA Large text (4.5:1), and AA UI components (3:1). Use the Preview tabs to see how the colors look for normal text, large text, and UI elements like buttons, inputs, and icons. If the colors fail AA, a suggested foreground color adjustment is shown that meets 4.5:1.

WCAG defines "large text" as text that is at least 18 point (approximately 24px at standard screen resolution) or at least 14 point bold (approximately 19px bold). All other text is "normal text." The rationale is that larger text is inherently easier to read at lower contrast, so it qualifies for a relaxed minimum of 3:1 instead of 4.5:1 for AA. In practice: body copy, labels, captions, navigation items, and most UI text are normal text. Page headings (typically H1–H2) are often large text. Always measure the rendered pixel size, not just the CSS font-size, since browser zoom and user settings can affect the actual size.

The most reliable approach is to darken the foreground (text) color or lighten the background color. This tool shows a suggested foreground hex value that meets 4.5:1 AA when the current combination fails — click "Use" to apply it. Generally: for light backgrounds, use darker text (lower lightness in HSL). For dark backgrounds, use lighter text (higher lightness). Avoid relying on hue changes alone — yellow on white and red on white both have very low contrast regardless of how saturated they are, because luminance is primarily driven by lightness and green content. Use the luminance values shown in this tool to understand which color has more room to adjust.

Disabled interface components and purely decorative content are explicitly exempted from WCAG contrast requirements (Success Criterion 1.4.3 exception). Placeholder text in form inputs is not formally exempted, but WCAG guidance notes that placeholder text is informational rather than required — however, many accessibility audits flag low-contrast placeholders as best-practice failures. The WCAG 2.1 Understanding document recommends that placeholder text also meets 4.5:1 where possible, as it helps users with low vision identify input purpose. Always verify with your organization's accessibility policy.

Relative luminance is a measure of how bright a color appears to the human eye on a linear scale from 0 (absolute black) to 1 (absolute white). It is calculated from the sRGB color values using a linearization formula that corrects for gamma encoding: each channel (R, G, B) is divided by 255, then converted to a linear value using the formula (c + 0.055) / 1.055 raised to the power 2.4 for values above 0.04045, or divided by 12.92 for values at or below 0.04045. The linearized channels are combined as L = 0.2126×R + 0.7152×G + 0.0722×B, reflecting the human eye's greater sensitivity to green light. Pure white (#ffffff) has luminance 1.0. Pure black (#000000) has luminance 0. Medium gray (#808080) has luminance approximately 0.216.