Contrast Checker
Check color contrast for accessibility.
Foreground (Text)
Pasting an 8 digit HEX like #00000080 moves its alpha here. The background stays opaque.
Background
Contrast Ratio
Preview
Large Text
Normal text sample.
WCAG Compliance
How to use this tool
Enter the foreground color
Type a hex code (like #1F2937) into the foreground field or use the color picker. This is the color of your text, icon, or UI element.
Enter the background color
Type a hex code into the background field or use the picker. This is the surface the foreground sits on. Reversing fg and bg gives the same ratio, so you can test both light-on-dark and dark-on-light in one pass.
Read the contrast ratio
The calculator returns the exact WCAG 2.1 contrast ratio (like 4.52:1 or 7.1:1) computed from the sRGB luminance of both colors. The live preview pane shows how the pairing actually looks on screen.
Check AA and AAA compliance
The result shows pass/fail for AA normal text (4.5:1), AA large text (3:1), AAA normal text (7:1), and AAA large text (4.5:1). If any tier fails, adjust the foreground or background lightness until it passes.
About this tool
The Contrast Checker calculates the WCAG 2.1 contrast ratio between two colors and shows whether the pairing passes at AA, AAA, or neither. Paste a foreground and background hex value (or use the pickers) to get the exact ratio, like 4.52:1 or 7.1:1, plus a pass/fail for normal text and large text at both levels. A live preview shows how the combination looks, so you're not judging by the number alone.
Use it whenever you pick text colors, link styles, button backgrounds, or error messages. Mid-gray text on white is easy to misjudge by eye, and the checker gives you a measured ratio you can cite in an accessibility audit or legal review.
WCAG thresholds
AA requires 4.5:1 for body text and 3:1 for large text (18pt+, or 14pt+ bold). AAA requires 7:1 and 4.5:1 respectively. Non-text UI (icons, borders, focus rings that carry meaning) needs 3:1 against its adjacent background under SC 1.4.11.
When to use it
Run every text and button color through it before shipping, especially for brand-heavy palettes where muted tints on tinted backgrounds can slip under AA. Pair with the Color Picker to dial in the exact hue or lightness adjustment needed to cross the threshold without changing the brand feel.
Popular contrast scenarios
Pre-computed contrast ratios and accessibility guidance for the most common WCAG questions.
Frequently asked questions
What is a WCAG AA contrast ratio?
What's the difference between WCAG AA and AAA?
How do I check the contrast of my brand colors?
Does white text on yellow fail WCAG?
What is contrast ratio and how is it calculated?
Do I need to pass WCAG for icons and logos?
Related tools
Color Picker
Pick colors and convert between HEX, RGB, HSL, CMYK, and HSV formats.
Use toolPPI & Retina Calculator
Calculate PPI and Retina distance for your display.
Use toolScreen Size Visualizer
Compare screen sizes side-by-side to visualize physical dimension differences.
Use toolJSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolUse this tool on your own site
Drop the Contrast Ratio Checker into your blog, docs, or CMS with one iframe snippet. Free, no signup. See all embeddable tools