Color Contrast Checker
Color ToolsCheck color contrast ratios between foreground and background for WCAG 2.1 AA and AAA compliance with live preview.. Free, private — all processing in your browser.
The quick brown fox jumps over the lazy dog
Normal text (16px) — Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Small text (14px) — Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
The Color Contrast Checker measures the WCAG contrast ratio between any two colors (foreground and background) to verify text will be readable for users with low vision, color blindness, or simply in difficult lighting conditions. Web accessibility standards (WCAG 2.1) require contrast ratios of at least 4.5:1 for normal text (AA level, mandatory in many jurisdictions) and 7:1 for enhanced accessibility (AAA). Large text has lower thresholds. UI elements and non-text content have their own rules. Missing these ratios means your design is unreadable for a substantial portion of users and may violate ADA, Section 508, or European Accessibility Act requirements.
This tool tells you the exact ratio, the pass or fail status at each WCAG level, and shows a live preview of how text actually looks at that ratio. Pick foreground and background colors with a color picker, paste hex codes, or type RGB values. The ratio updates instantly. If the combination fails, the tool suggests adjustments to the foreground or background colors that would bring it into compliance while staying close to your original intent. Works equally well for light mode (dark text on light background) and dark mode (light text on dark background), and handles semi-transparent foregrounds by computing the effective color against the background.
Color Contrast Checker — key features
WCAG 2.1 compliant
Uses the exact relative luminance formula specified by WCAG 2.1 for accurate, standards-compliant contrast ratios.
AA and AAA levels
Shows pass/fail for both AA (mandatory) and AAA (enhanced) at normal and large text thresholds.
Live preview
See actual text rendered in your color combination to confirm readability beyond just the numeric ratio.
Suggestions when failing
Proposes adjustments to foreground or background that bring the pair into compliance while staying close to your intent.
Transparent color support
Handles semi-transparent foregrounds by compositing over the background to give the effective contrast ratio.
Multiple input formats
Enter colors as hex, RGB, HSL, RGBA, or named colors — all parsed automatically.
UI component contrast
Separate check for 3:1 non-text contrast used by buttons, icons, and graphical UI elements.
Shareable URL
URL encodes the color pair for quick sharing with designers or reviewers.
How to use the Color Contrast Checker
- 1
Enter foreground color
Pick or paste the text color (typically this is the text, icon, or UI element color).
- 2
Enter background color
Pick or paste the background color behind the foreground.
- 3
Read the ratio
The contrast ratio appears instantly (e.g., 4.8:1), along with AA and AAA pass/fail status for normal and large text.
- 4
Preview
Inspect the live text preview to visually confirm readability.
- 5
Adjust if failing
If the pair fails, apply a suggested adjustment to bring it into compliance. Iterate until you find a combination you like that passes.
Common use cases for the Color Contrast Checker
Accessibility compliance
- →WCAG audit: Verify every text/background combination in a web application meets AA contrast requirements.
- →Design system review: Test design token combinations across primary, secondary, and tertiary text colors before release.
- →Legal compliance: Confirm color choices meet ADA, Section 508, European Accessibility Act, or other regional requirements.
UI and product design
- →Dark mode design: Verify dark-mode color pairs have sufficient contrast, which is a common failure area in dark themes.
- →Button states: Check hover, active, and disabled states maintain contrast relative to their surrounding background.
- →Error and warning colors: Confirm red/yellow warning text is readable on its backdrop, especially for users with color vision deficiencies.
Brand and identity
- →Brand color usability: Test whether brand colors are usable as text or require a different accent color for body copy.
- →Marketing material: Verify landing page, banner, and ad copy meets accessibility standards for broad audience reach.
- →Email design: Check contrast in HTML emails where recipients may view in dark mode (which inverts colors unpredictably).
Color Contrast Checker — examples
Passing AA
Dark gray on white — passes AA, almost AAA.
foreground: #333333 background: #FFFFFF
ratio: 12.63:1 AA: pass AAA: pass (both normal and large text)
Failing AA
Light gray on white — common design mistake.
foreground: #CCCCCC background: #FFFFFF
ratio: 1.61:1 AA: fail suggestion: darken to #767676 for ratio 4.54:1 (passes AA)
Warning color
Yellow text on light background — often hard to read.
foreground: #FFCC00 background: #FFFFFF
ratio: 1.62:1 AA: fail suggestion: use #B8860B or similar darker yellow for readability
Dark mode
Light text on dark — passes AA.
foreground: #E0E0E0 background: #1A1A1A
ratio: 14.85:1 AA and AAA: pass (both)
Large text pass
Combination that passes AA for large text but not normal.
foreground: #757575 background: #FFFFFF
ratio: 4.47:1 AA normal: fail (barely — 4.5 required) AA large: pass (3:1 required)
Technical details
WCAG 2.1 defines contrast ratio using relative luminance per ISO 9000 and ITU-R BT.709. The formula:
For each color, compute relative luminance L = 0.2126×R + 0.7152×G + 0.0722×B
where R, G, B are normalized sRGB channel values with gamma correction:
if channel ≤ 0.03928: channel_normalized = channel / 12.92
else: channel_normalized = ((channel + 0.055) / 1.055)^2.4
Then contrast ratio = (L_lighter + 0.05) / (L_darker + 0.05)
The result ranges from 1:1 (identical colors) to 21:1 (pure black on pure white).
WCAG thresholds:
- AA for normal text: 4.5:1
- AA for large text (18pt regular or 14pt bold): 3:1
- AAA for normal text: 7:1
- AAA for large text: 4.5:1
- Non-text contrast (UI components, graphical objects): 3:1
Large text has lower thresholds because bigger text is easier to read regardless of contrast. The threshold for \"large\" is 18pt (24px) regular weight or 14pt (18.67px) bold.
The gamma correction step is critical — linear RGB would give incorrect results because monitor brightness is not linear with pixel value. The transfer function converts sRGB values to linear light values that the human visual system responds to linearly.
Transparent foreground: if the foreground has alpha < 1, the effective color is the composite of foreground over background. Formula: effective = alpha × foreground + (1 - alpha) × background. The tool handles this automatically.
Suggestion logic: if a pair fails, the tool iteratively darkens the foreground or lightens the background (in HSL space, adjusting lightness) until the ratio passes. The result is typically the closest compliant color to the original intent.
Common problems and solutions
⚠Large text threshold confusion
Large text is defined as 18pt regular or 14pt bold (roughly 24px or 18.67px in CSS). Smaller text needs the 4.5:1 threshold regardless of weight. Do not apply the 3:1 rule to 14pt regular text.
⚠UI components vs text
Non-text graphical elements (buttons, icons) need 3:1 contrast against adjacent colors per WCAG 2.1 SC 1.4.11. This is different from text contrast. Use the UI component mode for these.
⚠Relying on color alone
Contrast is necessary but not sufficient for color-dependent meaning. Never use color alone to convey information (error in red without icon or text). Check color-blindness simulation alongside contrast.
⚠Transparent colors miscomputed
A semi-transparent foreground on a white background has different effective contrast than on a black background. Always composite over the actual background when computing contrast.
⚠Dark mode readability
Dark themes require even more care because pure white on pure black (21:1) can cause eye strain. Use softer off-white (#E0E0E0) on dark gray (#1A1A1A) rather than maxing contrast.
⚠Gradient backgrounds
Text over a gradient has different contrast at different points. Check the worst case (lightest part of background if text is dark, or darkest if text is light) rather than averaging.
⚠APCA vs WCAG 2.1
APCA (Accessible Perceptual Contrast Algorithm) is an upcoming WCAG 3 approach that handles dark text better than WCAG 2.1. For now, WCAG 2.1 is the legally binding standard; APCA is worth exploring for design quality.
Color Contrast Checker — comparisons and alternatives
Compared to browser DevTools contrast checkers, this tool gives a dedicated interface for testing multiple combinations without inspecting each DOM element. DevTools is still ideal for testing a live page; this tool is for design exploration.
Compared to WebAIM\u2019s contrast checker, this tool provides live preview, suggestion of passing alternatives, and handles transparent foregrounds. WebAIM remains an excellent reference; this tool builds on that with more features.
Compared to Figma\u2019s accessibility plugins, this browser tool works on any color values without requiring the Figma environment. Plugins are convenient in the design workflow; this tool is for ad-hoc checks.
Frequently asked questions about the Color Contrast Checker
▶What is a good contrast ratio for text?
WCAG AA requires at least 4.5:1 for normal text and 3:1 for large text (18pt+ regular or 14pt+ bold). AAA requires 7:1 for normal and 4.5:1 for large. Most commercial sites aim for AA; AAA is the gold standard for accessibility-critical content.
▶What is WCAG?
Web Content Accessibility Guidelines, published by the W3C. WCAG 2.1 is the current stable version, widely adopted as a legal standard (ADA in the US, EN 301 549 in Europe, similar regulations elsewhere). Contrast is one of many WCAG requirements.
▶How is contrast ratio calculated?
Compute relative luminance (a weighted sum of gamma-corrected RGB channels) for both colors. Then ratio = (L_lighter + 0.05) / (L_darker + 0.05). The formula is exact per WCAG 2.1 — this tool uses that formula directly.
▶What counts as large text?
18pt (approximately 24px in CSS) regular weight or 14pt (18.67px) bold. In CSS terms, the large text threshold is roughly 1.5rem for regular weight or 1.17rem for bold on a 16px root font size. Below that size, normal-text thresholds apply.
▶Why does my button fail AAA but pass AA?
AAA is a stricter threshold (7:1) meant for enhanced accessibility. Many designs that look fine and meet AA do not meet AAA. AAA is not required by law in most places but is a worthwhile target for accessibility-first products.
▶Does it handle dark mode correctly?
Yes. The formula is symmetric — it works whether foreground is darker or lighter than background. Contrast ratios for dark-mode pairs (light text on dark background) are computed correctly.
▶How do I fix a failing color combination?
Use the suggestion feature. The tool proposes the closest foreground or background color that meets the target threshold. Iterate from there to find something that feels right aesthetically while meeting accessibility. You may also consider choosing a different color entirely.
▶Does the tool support APCA?
The tool uses WCAG 2.1 by default because it is the legal standard. APCA (being developed for WCAG 3) handles dark text more accurately but is not yet standardized. Watch for updates as WCAG 3 progresses.
Additional resources
- WCAG 2.1 Contrast — Authoritative WCAG 2.1 contrast requirements and how they apply to text.
- WebAIM Contrast Checker — Widely used reference contrast checker, good for cross-verifying results.
- APCA overview — Accessible Perceptual Contrast Algorithm, the upcoming WCAG 3 approach to contrast.
- MDN color contrast — MDN guidance on designing accessible color combinations.
- Section 508 of the Rehabilitation Act — US federal accessibility law, which references WCAG as its technical standard.
Related tools
All Color ToolsColor Blindness Simulator
Simulate how colors and images appear to users with protanopia, deuteranopia, tritanopia, achromatopsia, and other color vision deficiencies.
Color Converter
Convert between HEX, RGB, HSL, HSV, CMYK, Lab, LCH color formats
Color Name Finder
Find the nearest named color for any hex, RGB, or HSL value from CSS web colors, X11 standard colors, and Pantone approximations.
Color Palette Generator
Generate harmonious color palettes from any base color with complementary, analogous, triadic, and monochromatic schemes.
Color Picker
Pick colors interactively and get HEX, RGB, HSL, HSV, and CMYK values with alpha, plus save swatches to build palettes you can copy straight into CSS, Figma, or code.
Color Shades Generator
Generate tints (lighter), shades (darker), and tones (desaturated) from any base color for design systems and UI states.
Learn more
Explore more tools
200+ free tools that run in your browser.
Browse all tools →