Colours to compare
Enter two six-digit hex colours, or use the colour pickers. The preview and results update instantly.
Live text preview
The quick brown fox jumps over the lazy dog.
Small text example · 14pxContrast results
These checks apply to text contrast under WCAG 2.2. A passing contrast ratio alone does not establish overall accessibility compliance.
More Information
How to use this contrast checker
Choose a foreground text colour and a background colour. You can paste a six-digit hexadecimal value such as #172B4D, or select a colour with the browser picker. The contrast ratio, pass/fail indicators and text preview update automatically. Use Swap colours to reverse the foreground and background.
How contrast is calculated
WCAG contrast is the ratio between the relative luminance of the lighter and darker colours: (Lighter luminance + 0.05) ÷ (Darker luminance + 0.05). Each sRGB channel is linearised before its contribution to luminance is calculated. The maximum ratio is 21:1 for black against white; identical colours have a ratio of 1:1.
WCAG AA and AAA thresholds
WCAG AA requires at least 4.5:1 for normal text and 3:1 for large text. AAA requires 7:1 for normal text and 4.5:1 for large text. Large text generally means at least 18pt regular or 14pt bold. The displayed thresholds are based on WCAG 2.2 Success Criteria 1.4.3 and 1.4.6.
Practical example
Black text (#000000) on white (#FFFFFF) produces a 21:1 ratio, passing all four checks. White text on white has a 1:1 ratio and fails all four. Test your real interface colours rather than relying on a colour's appearance alone.
Limitations
This tool checks opaque hex colours, not gradients, transparency, image backgrounds or text effects. Non-text interface components may have other contrast requirements. Colour contrast is only one part of accessibility: keyboard support, semantics, focus visibility and understandable content also matter.
Frequently asked question
Does passing AA mean my website is WCAG compliant? No. It means the selected colour pair meets the stated text contrast threshold; an accessible website must satisfy many additional success criteria.
Reference: W3C — Understanding Contrast (Minimum).