CSS Contrast Color Finder

Check which text color reads best on any background, and whether it passes WCAG.

What is this tool?

The CSS Contrast Color Finder takes a color, or a block of CSS, and works out whether black or white text reads better on top of it. For each color it shows the contrast ratio and whether it passes WCAG AA and AAA.

It also lists all possible contrast colors for a background, which you can filter to AA (4.5:1 or more) or AAA (7:1 or more).

What can you do with this tool?

  • Check a single background color with the Quick Contrast Finder.
  • Paste CSS and check every color in it at once.
  • Get the recommended text color (black or white) and its contrast ratio.
  • See AA and AAA pass or fail badges so accessibility problems show up early.
  • Browse all possible contrast colors for a background, filtered by AA or AAA.

How to use it

  1. For one color, type it into the Quick Contrast Finder (for example #2196f3, rgb(64,64,64) or hsl(0,0%,25%)) and click Show Contrast.
  2. For many colors, paste CSS into the box and click Find Contrast Colors.
  3. Read the recommended text color, the ratio and the AA / AAA badges on each card.
  4. Use the AA and AAA filters on the "All possible contrast colors" list to narrow the options. Click Clear to reset.

FAQ

What do WCAG AA and AAA mean?

They are accessibility levels for text contrast. AA needs a contrast ratio of at least 4.5:1 for normal text (3:1 for large text). AAA needs 7:1.

Why only black or white text?

The tool picks whichever of black or white scores the higher contrast against your color. The "All possible contrast colors" list shows other options.

Which color formats can I enter?

Hex, rgb(), rgba(), hsl() and hsla(), either as a single value, a CSS property, or a whole selector block.

Is my CSS uploaded anywhere?

No. Everything runs in your browser and nothing you enter is sent to a server. It is free, with no sign-up.

More free tools

See all free tools →