Check whether your text is easy to read on its background. Enter a text color and a background color, or click the swatches to pick them, and the checker gives you the contrast ratio and shows whether the pair passes the WCAG AA and AAA levels for normal text, large text and interface elements. If a pair fails, you get the closest text color that passes. Everything runs in your browser, and nothing you enter is sent to a server.
Contrast is the difference in brightness between text and its background. The higher the ratio, the easier the text is to read, especially for people with low vision.
How to use the color contrast checker
- Enter the colors: type a HEX code in the text and background fields, or click a swatch to open your browser's color picker.
- Watch the preview: the sample at the top shows your real text on your real background, along with the ratio.
- Read the results: each row shows Pass or Fail for one WCAG requirement.
- Fix a failing pair: click a suggested text color to use the closest one that reaches AA or AAA.
- Swap the colors: press Swap colors to test light text on a dark background and the other way round.
- Pick from your screen: in browsers that support it, such as Chrome and Edge, press Pick text from screen or Pick background from screen and click any pixel.
WCAG contrast requirements
The Web Content Accessibility Guidelines set minimum contrast ratios. The checker tests your pair against each one.
| Level | Minimum ratio | Applies to |
|---|---|---|
| AA normal text | 4.5:1 | Body text smaller than 24 px, or smaller than 18.66 px if bold |
| AA large text | 3:1 | Text of 24 px or more, or 18.66 px or more if bold |
| AAA normal text | 7:1 | The enhanced level for body text |
| AAA large text | 4.5:1 | The enhanced level for large text |
| UI components | 3:1 | Borders of inputs, icons and other graphics needed to understand a page |
What this tool does and does not do
The tool calculates the contrast ratio between two opaque sRGB colors using the WCAG 2.x formula, and it shows whether the pair meets each level. It does not test transparency, gradients, background images or text on photos, so for those cases check the colors in the real design. The ratio is shown rounded down to two decimals, so a pair at 4.499:1 is never shown as passing. Passing a ratio does not guarantee readability, because font weight, size and spacing also matter, and a passing score does not replace testing with real users.
Tips for better results
- Aim for AA as a minimum: 4.5:1 for body text is the common legal and design target.
- Do not rely on color alone: use labels, icons or underlines so the meaning is clear without color.
- Check hover, focus and disabled states: each state needs enough contrast on its own.
- Test both themes: a pair that passes in light mode can fail in dark mode, so swap and check again.
- Pure black on pure white is not required: dark gray on white often reads more comfortably and still passes.
Test your pair once, fix what fails, and move on. The suggested colors keep your hue and change only the lightness, so the result still matches your brand.
Common color contrast problems
- The HEX field will not accept my code: use three or six letters and numbers from 0 to 9 and A to F, such as #FA0 or #FFAA00.
- My pair fails AA: make the text darker on a light background, or lighter on a dark one. The suggestions below the results do this for you.
- No suggestion is shown: if the background is a mid-tone color, no text color of the same hue may reach the target. Try changing the background.
- Pick from screen is missing: the screen picker needs a browser that supports it, such as a current Chrome or Edge. Use the swatch or type the code instead.
- My colors disappeared: they are saved in your browser. Clearing site data or using a private window removes them.
Frequently asked questions
Is this color contrast checker free?
Yes. There is no sign-up and no limit on how many pairs you test.
What is a good contrast ratio?
For normal text, 4.5 to 1 or more meets WCAG AA and 7 to 1 or more meets AAA. For large text, 3 to 1 meets AA.
How is the contrast ratio calculated?
The tool finds the relative luminance of each color, then divides the lighter value plus 0.05 by the darker value plus 0.05. The result runs from 1 to 1 for identical colors up to 21 to 1 for black on white.
What counts as large text?
WCAG treats text as large at 24 px (18 pt) or more, or at 18.66 px (14 pt) or more when it is bold.
Does the order of the colors matter?
No. The ratio is the same whichever color is the text and whichever is the background. Swapping only changes the preview.
Are my colors sent anywhere?
No. All calculations run in your browser, and the last colors you used are saved only on this device.
Can I pick a color from anywhere on my screen?
Yes, in browsers that support the screen picker, such as Chrome and Edge. Press Pick text from screen or Pick background from screen, then click any pixel on your display.