Color Contrast Checker
Choose text and background colors to see their contrast ratio and threshold results.
Sample heading text
Sample body text in the same color pair.
Contrast ratio
Ratio 17.40:1 for this pair.
17.40:1
| Check | Needs | Verdict |
|---|---|---|
| Normal text, AABody text below 24px, or below 18.66px bold. | 4.5:1 | Pass (17.40:1) |
| Large text, AAAt least 24px, or 18.66px bold and above. | 3:1 | Pass (17.40:1) |
| Normal text, AAAEnhanced level for body text. | 7:1 | Pass (17.40:1) |
| Large text, AAAEnhanced level for large text. | 4.5:1 | Pass (17.40:1) |
| UI components and graphicsBounds of inputs, icons, and other non-text elements (SC 1.4.11). | 3:1 | Pass (17.40:1) |
Verdicts use the unrounded ratio. This checks one color pair, not a whole page, and passing a ratio is not a certification of accessibility.
Why use our Color Contrast Checker?
Every Threshold at Once
One pair is checked against normal text and large text at AA and AAA, plus the 3:1 line for UI components, in a single table.
Exact at the Edges
Pass or fail uses the unrounded ratio, so a pair that rounds to 4.50:1 but sits just below the line is still reported as a fail.
Verdicts in Words
Each row says Pass or Fail with the ratio next to it, so the result does not depend on telling two colors apart.
What is a Color Contrast Checker?
A color contrast checker measures how far apart a text color and its background are in relative luminance, and compares that ratio with the WCAG 2 minimums. Enter two opaque HEX colors, or pick them, and the ratio and every verdict update as you type.
Each channel is converted to relative luminance using the WCAG 2 formula, then the ratio is (lighter + 0.05) / (darker + 0.05). Black on white gives 21:1 and identical colors give 1:1. Values shown are rounded to two decimal places for reading only.
Which threshold applies
- AA (SC 1.4.3):WCAG 2 SC 1.4.3 sets 4.5:1 for normal text and 3:1 for large text at AA.
- AAA:The enhanced level asks for 7:1 for normal text and 4.5:1 for large text.
- Large text:Large text means 18pt (24px) or 14pt (18.66px) bold, so bold 14px body text still needs 4.5:1.
- UI (SC 1.4.11):SC 1.4.11 sets 3:1 for the visual boundary of UI components and meaningful graphics.
- Unrounded ratio:Pass or fail is decided on the unrounded ratio, as W3C guidance requires at threshold edges. A pair at 4.6:1 clears AA for normal text; if a design tweak lowers it to 4.48:1 it fails, even though both may look the same.
- Floors:The AA ratios are floors, not targets, so keep a margin while the design is still moving.
Common Use Cases
Body Text
Check a paragraph color against the page background before it ships, where the 4.5:1 normal-text line applies.
Buttons on Brand Colors
Test white or dark label text on a brand-colored button and see which one clears the threshold.
Input Borders and Icons
Compare a field border or an icon with the surface behind it against the 3:1 line for UI components.
Grey Text Scales
Find the lightest grey in a palette that still passes for body copy, and the step where it starts to fail.
Tinted Cards and Banners
Check text on a pale tinted surface, where a small change in lightness can move the ratio across a threshold.
Large Headings
See whether a lighter heading color is allowed at 24px or 18.66px bold, where the AA large-text line of 3:1 applies.
How to check a color pair
Enter the text color
Type an opaque HEX value for the text, or choose one with the color picker next to the field.
Enter the background
Type or pick an opaque HEX value for the background. The sample box shows the pair together.
Read the verdict
Check the ratio and the appropriate normal-text, large-text, or UI verdict in the result table.
Adjust and recheck
Adjust a color that fails, check again, then test the final rendered component in context.
How to fix a failing pair
Find the Cause
A fail means the two values are too close in relative luminance.
Move the Background
Fix the side that matters less to the design: if the text color is your brand color, move the background away from it, lighter behind dark text or darker behind light text.
Move the Text
If the background is fixed, move the text color away from it until the ratio crosses the threshold.
Change One Value
Changing one value is easiest to reason about: a slate background of #334155 with #64748b text gives 2.18:1, while lifting the text to #cbd5e1 takes the same background to 6.97:1, past AA for normal text but just under the 7:1 AAA line.
Weight Is No Rescue
Do not rely on font weight to rescue a pair. The checker measures color only, so a heavier weight never changes the ratio.
Check the Final Component
After the numbers pass, look at the rendered component in context, with its real font size, weight and surroundings.
Picking colors that already pass
- •Near-black: Near-black text on white is the safest default for body copy: #1a1a1a on #ffffff is about 17.4:1.
- •Lighter greys: The ratio falls as the text lightens. #767676 on white is about 4.54:1 and sits just over the AA line.
- •The accidental grey: #999999 on white is about 2.85:1 and fails for normal text. Designers take that step by accident when the grey looks tasteful on a large monitor.
- •Tinted backgrounds: Keep the hue and move the lightness: pale blue with dark navy text usually clears the thresholds, while the same surface with medium blue text does not.
- •White on brand: For white text on a brand color, check the brand color first; many saturated mid-tone blues, oranges, and greens sit below 4.5:1 against white.
- •Try shades: Use the color picker beside each field to try nearby shades, then copy the final text color with Copy text color.
Check Your Next Color Pair
Paste the text and background HEX values from your design and read every WCAG 2 verdict at once, before the pair reaches a stylesheet.
A passing ratio is a good start, not the finish: test the final rendered component in context, and keep the underline on links in body text.
What this pair check cannot verify
Opaque HEX Only
Only opaque 3-digit and 6-digit HEX values are accepted, so alpha colors, gradients, and text over images need a solid backdrop before they can be measured.
Rendered Typography
Thin weights, wide letter spacing, and all-caps reduce legibility without changing the ratio. A screen's gamma, brightness, and color profile also change how the same pair looks.
The Rest of the Page
Placeholder text, focus indicators, chart lines, and icons carry their own requirements, and inactive components have exceptions under SC 1.4.11. A pair result is not a full accessibility audit.
Hue Differences
The ratio compares luminance, so red and green of similar lightness can pass as distinct to some readers and merge for readers with color vision deficiency. A greyscale preview checks that separately.
Links that differ only by color
Color Alone Is Not Enough
WCAG SC 1.4.1 does not let color be the only way to identify a link inside body text. An underline or another non-color cue is the reliable fix.
The G183 Exception
W3C technique G183 also accepts a 3:1 contrast between the link and the surrounding text, but only together with a non-color cue on hover and keyboard focus.
Keep the Underline
Checking the link color against the page background does not answer that question, so keep the underline unless you have verified both.