How to Calculate Color Contrast Ratio
Check color contrast ratios for WCAG 2.1 accessibility compliance. Free online contrast checker with AA/AAA ratings, color suggestions, and real-time preview.
Open Contrast Checker →Step-by-Step Guide
Enter foreground and background colors
Type or paste your foreground (text) color and background color using any supported format — hex (#ffffff), RGB, or HSL. You can also use the color picker to visually select colors. The tool updates the preview in real time so you can see exactly how the combination looks.
Read the contrast ratio
The tool calculates the contrast ratio between your two colors using the WCAG 2.1 relative luminance formula. The ratio is displayed as a value between 1:1 (no contrast) and 21:1 (maximum contrast, black on white). Higher ratios mean better readability for all users, including those with visual impairments.
Understand AA vs AAA compliance levels
WCAG AA requires a minimum ratio of 4.5:1 for normal text and 3:1 for large text (18px+ bold or 24px+ regular). WCAG AAA is stricter — 7:1 for normal text and 4.5:1 for large text. The tool shows pass/fail badges for each level so you can quickly verify your design meets accessibility standards.
Adjust colors to meet requirements
If your combination fails, tweak the lightness or saturation of either color until the ratio passes your target level. Small adjustments often suffice — darkening text by 10-15% or lightening the background can push a failing 3.8:1 ratio above the 4.5:1 AA threshold. Use the live preview to ensure the adjusted colors still match your design intent.
Try It Now — Free
No signup, no download. Runs entirely in your browser.
Open Contrast Checker