# Color Contrast Checker

URL: https://hifreetools.com/color/color-contrast-checker

> A Color Contrast Checker ensures your text is readable against its background by calculating the WCAG 2.x contrast ratio and verifying compliance with accessibility standards. Perfect for web designers and developers building inclusive interfaces.

## Quick answer

Enter a text color and background color in HEX format to instantly see the contrast ratio (1:1 to 21:1) and whether it passes WCAG AA (4.5:1 for normal text) or AAA (7:1) standards. Black text on white reaches the maximum 21:1 ratio.

The checker uses the WCAG 2.x relative luminance formula to calculate contrast between two colors. Each hex color is converted to RGB, then to relative luminance (0–1 scale), and the ratio is computed as (lighter luminance + 0.05) ÷ (darker luminance + 0.05). The result (1:1 to 21:1) is tested against WCAG AA (4.5:1 normal, 3:1 large text ≥18pt or ≥14pt bold) and AAA (7:1 normal, 4.5:1 large) thresholds.

## Examples

- Black text on white (maximum contrast): Text: #000000, Background: #FFFFFF → 21:1 ratio — Passes WCAG AAA for all text sizes
- Dark gray on light background (typical pass): Text: #333333, Background: #F5F5F5 → 11.59:1 ratio — Passes WCAG AAA for all text sizes
- Medium blue on white (passes AA, fails AAA): Text: #0066CC, Background: #FFFFFF → 5.57:1 ratio — Passes AA for normal text; fails AAA for normal text (passes AAA for large text)

## FAQ

**What is WCAG and why does contrast matter?**
WCAG (Web Content Accessibility Guidelines) is a W3C standard ensuring digital content is usable by everyone, including people with visual impairments. Sufficient contrast between text and background is critical for readability. WCAG 2.x defines two conformance levels: AA (minimum) and AAA (enhanced).

**What's the difference between AA and AAA?**
WCAG AA is the baseline standard (4.5:1 for normal text). WCAG AAA is a higher, more inclusive standard (7:1 for normal text). W3C does not recommend requiring AAA for entire sites, because some content cannot meet it. AA is the level most accessibility laws and policies reference.

**Does large text have different contrast requirements?**
Yes. WCAG defines 'large text' as 18pt (24px) or larger, or 14pt (about 18.7px) bold or larger. Large text requires 3:1 for AA and 4.5:1 for AAA, which are easier to achieve than normal text (4.5:1 AA, 7:1 AAA).

**Is this tool enough to guarantee accessibility?**
Contrast is only one accessibility requirement. You should also test for color blindness (avoid using color alone to convey meaning), keyboard navigation, screen reader compatibility, and text size flexibility. Use this tool as part of a broader accessibility audit.

**Why might colors look readable on my screen but fail this tool?**
Your monitor's brightness, gamma, and color calibration affect how colors appear to your eyes, but this tool calculates contrast using the WCAG 2.x algorithm based on the actual hex values you enter. The ratio is mathematically objective; perceived readability is subjective and display-dependent.

**Can I use this tool offline?**
Yes. This tool runs 100% in your browser with no data uploaded to any server. You can use it offline once the page has loaded, and all calculations are instant.


## Sources

- [WCAG 2.1 Contrast Minimum (Level AA)](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html)
- [WCAG 2.1 Contrast Enhanced (Level AAA)](https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced.html)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Color Contrast Checker", https://hifreetools.com/color/color-contrast-checker
