WCAG Color Contrast Checker & Calculator
Calculate exact contrast ratios for foreground text and background colors against WCAG Level AA and AAA standards with live typography previews.
Color Selection
Live Typography & Component Preview
This is a demonstration of body text rendered using foreground color #FFFFFF on background color #0D0E10. Verify legibility under actual reading conditions.
Understanding WCAG Contrast Ratios & How to Use This Checker
1. What This Tool Actually Calculates
This checker converts your two hex colors into sRGB channels, applies the WCAG gamma-correction curve to derive each color's relative luminance, and then computes the contrast ratio using the official formula: (L1 + 0.05) / (L2 + 0.05), where L1 is the lighter of the two relative luminances and L2 is the darker. The result is a single number between 1:1 (identical colors, zero contrast) and 21:1 (pure black on pure white, maximum contrast).
That single ratio is then checked against four separate thresholds simultaneously โ normal text AA, normal text AAA, large text AA, and non-text UI components AA โ because a color pair can pass one threshold while failing another. A ratio of 3.5:1, for instance, is perfectly compliant for a large heading but fails for 14px body copy.
2. How to Use the Contrast Checker
- Enter your text (foreground) color as a hex value, or click the color swatch to open the native color picker.
- Enter your background color the same way, or select one of the sample combinations to instantly load a real-world pairing.
- Read the calculated ratio in the scorecard โ it updates live with every keystroke, with no page reload or server round trip.
- Check the four pass/fail badges: Normal Text AA, Normal Text AAA, Large Text AA, and UI Components AA โ each reflects a distinct WCAG threshold.
- Use the "Swap" button to instantly test the reverse pairing (useful for checking both light-on-dark and dark-on-light variants of the same two brand colors).
- Scroll to the live preview to see how the pairing actually renders as a heading, paragraph, button, and badge โ a ratio can technically pass while still looking uncomfortable in real typography.
3. The WCAG Success Criteria Involved
Three distinct WCAG success criteria govern color contrast, and this tool checks all of them at once:
- 1.4.3 Contrast (Minimum) โ Level AA: Normal text must reach at least 4.5:1; large text (โฅ18pt, or โฅ14pt bold) must reach at least 3:1.
- 1.4.6 Contrast (Enhanced) โ Level AAA: A stricter, optional criterion requiring 7:1 for normal text and 4.5:1 for large text. Few commercial sites target full AAA site-wide, but it is often applied to specific high-priority reading content.
- 1.4.11 Non-text Contrast โ Level AA: Introduced in WCAG 2.1, this requires a 3:1 ratio for the visual boundaries of UI components (input borders, checkbox outlines, active states) and for graphical objects required to understand content (icons, chart lines), measured against their immediately adjacent color.
Logos, purely decorative graphics, and text that is part of an inactive/disabled control are explicitly exempted from 1.4.3, though disabled-state contrast is still good practice for usability.
4. A Worked Example
Load the tool's default pairing: white text (#FFFFFF) on a near-black background (#0D0E10). Running both hex values through the relative-luminance formula gives L1 = 1.0 (white) and L2 โ 0.00437 (near-black), producing a ratio of (1.0 + 0.05) / (0.00437 + 0.05) โ 19.31:1.
That comfortably clears every threshold at once: 4.5:1 (normal AA), 7:1 (normal AAA), 3:1 (large AA/AAA), and 3:1 (UI components) โ which is why high-contrast dark themes are a common, low-risk default for text-heavy interfaces. Compare that to the "Subtle Muted Text" preset (#71767B on #000000), which lands closer to 4.6:1 โ technically a pass for normal-text AA, but with almost no margin, meaning a slightly darker gray or a slightly-off black background could tip it into failure.
5. Who Actually Uses This Tool
- Digital agencies running ADA/Section 508 audits: quickly verify every color pair in a client's brand palette (body text, links, buttons, badges) before delivering a remediation report.
- WordPress theme and page-builder developers: validate default theme color combinations (Elementor global colors, Gutenberg palette entries) so end users don't unknowingly ship inaccessible defaults.
- Government and education site owners: confirm Section 508 / EN 301 549 conformance for civic and .edu portals where accessibility is often a procurement requirement, not just best practice.
- Product and UI designers: stress-test a design system's semantic colors (success green, warning amber, error red) against both light and dark surface tokens before they ship to engineering.
6. Common Mistakes & Limitations
- Testing against the wrong background: if text sits over an image, gradient, or semi-transparent overlay, a single flat-color check isn't sufficient โ the darkest and lightest regions of the background both need to be tested.
- Ignoring hover/focus/disabled states: a button that passes in its default state can fail once a hover overlay or opacity reduction is applied.
- Confusing "large text" thresholds: 18px bold body copy does not automatically qualify as "large text" โ the WCAG threshold is 14pt bold (~18.66px), and font-weight matters as much as size.
- Treating a pass as a full accessibility clearance: this tool checks one criterion in isolation. A page can have perfect contrast ratios everywhere and still fail on missing alt text, broken heading order, or unlabelled form fields โ all of which need their own dedicated checks.
Frequently Asked Questions
What is the minimum WCAG color contrast requirement?
Under WCAG 2.1 and 2.2 Level AA, normal body text requires a contrast ratio of at least 4.5:1 against its background. Large text (at least 18pt or 14pt bold) requires at least 3:1. For enhanced Level AAA conformance, normal text requires 7:1 and large text requires 4.5:1.
Do UI components and borders need to meet color contrast standards?
Yes. WCAG 2.1 Success Criterion 1.4.11 (Non-text Contrast) requires a minimum 3:1 contrast ratio for user interface components (such as form field borders, active tab outlines, and button boundaries) and graphical objects against adjacent colors.
How does high color contrast benefit all users, not just visually impaired visitors?
High contrast improves reading speed, comprehension, and usability in outdoor sunlight, on low-brightness mobile screens, or for aging users experiencing natural contrast sensitivity decline.
Why should placeholder text in form inputs meet contrast standards?
Low-contrast gray placeholder text is a common accessibility violation. Browsers often default placeholder text to ~2.5:1 ratio, making it unreadable for low-vision users. Placeholders should never replace persistent <label> elements.
What officially counts as "large text" under WCAG 1.4.3?
Large text is defined as at least 18 point (approximately 24px) regular weight, or at least 14 point (approximately 18.66px) bold weight. Below these thresholds, text is classified as "normal" and must meet the stricter 4.5:1 ratio rather than the 3:1 large-text threshold.
Does this tool use the same contrast math as WebAIM and Chrome DevTools?
Yes. This checker implements the WCAG 2.x relative luminance and contrast ratio formulas defined in the official specification (sRGB gamma correction followed by the (L1 + 0.05) / (L2 + 0.05) ratio). Ratios computed here will match WebAIM's Contrast Checker and Chrome DevTools' contrast ratio readout for the same hex pairs.
Is there a newer contrast model than the WCAG 2.x formula?
Yes. The Advanced Perceptual Contrast Algorithm (APCA) is being developed for a future WCAG 3.0 and better models how the human eye perceives contrast, particularly for dark-mode UIs. It is not yet an official, adopted success criterion, so WCAG 2.1/2.2 Level AA and AAA ratios (as calculated by this tool) remain the current legal and technical benchmark.
Passing the ratio check here โ is that enough for full compliance?
No. This tool verifies one specific, objectively measurable criterion (contrast ratio between two flat colors). It cannot evaluate contrast against photographic backgrounds, gradients, or semi-transparent overlays, and it does not replace a full manual accessibility audit covering the remaining WCAG success criteria.
