Check color contrast ratios against WCAG AA and AAA standards for normal and large text. Enter two colors and see instant pass/fail results with the ratio.
Accessible preview text
Contrast ratio
14.63:1
WCAG AA
Pass
Normal text · 4.5:1
WCAG AA
Pass
Large text · 3:1
WCAG AAA
Pass
Normal text · 7:1
WCAG AAA
Pass
Large text · 4.5:1
Accessible color contrast helps people read text across different displays, lighting conditions, and visual abilities. This checker compares foreground and background colors, calculates their WCAG contrast ratio, and reports all four text thresholds.
Colors are converted from sRGB to relative luminance. The lighter luminance is placed above the darker luminance in this formula:
contrast ratio = (L1 + 0.05) / (L2 + 0.05)
L1 is the lighter color and L2 is the darker color. Ratios range from 1:1 for identical colors to 21:1 for ideal black and white.
| Criterion | Normal text | Large text |
|---|---|---|
| AA | 4.5:1 or higher | 3:1 or higher |
| AAA | 7:1 or higher | 4.5:1 or higher |
WCAG defines large text as at least 24px regular text or 18.67px bold text. Text that does not meet the large-text definition must pass the normal-text threshold.
Do not rely on color contrast alone. Text size, font weight, line height, letter spacing, surrounding colors, and non-color cues all influence usability. Interactive controls should also have a visible focus indicator.
function contrastRatio(foreground, background) {
const l1 = relativeLuminance(foreground);
const l2 = relativeLuminance(background);
return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
}
:root {
--text-primary: #1e293b;
--surface-primary: #ffffff;
}
.body-copy {
color: var(--text-primary);
background: var(--surface-primary);
}
def contrast_ratio(lighter, darker):
return (max(lighter, darker) + 0.05) / (min(lighter, darker) + 0.05)
WCAG also includes requirements for meaningful graphics, icons, and focus indicators. A decorative image may not need the same treatment, but an icon that communicates status or a control boundary should remain distinguishable from its surroundings.
This tool is provided for general informational and utility purposes only. Results may be inaccurate, incomplete, outdated, or contain errors. Always verify results before relying on or using them.
Some tools may use AI, automated processing, third-party services, or server-side processing. Do not rely on these tools as a substitute for professional advice.
Use at your own risk. BestToolOnline makes no guarantees regarding the accuracy, reliability, completeness, availability, or suitability of results, to the maximum extent permitted by applicable law.
See our Terms of Service and Privacy Policy for complete details.