Colour Converter and Contrast Checker

Type a colour as HEX, RGB or HSL and see it in all three forms with a swatch. Add a second colour to get the WCAG contrast ratio and the AA and AAA results.

Use the tool

Loading the tool…

About Colour Converter and Contrast Checker

Convert a colour between formats, such as hex and RGB. Optionally, enter a second colour to check the contrast between them.

Worked example

Enter #1a73e8. The tool shows the same colour as an RGB value.

Limits

The contrast check compares two colours only. Check the result for the text size you use, because accessibility rules set different minimums for different text.

How to use Colour Converter and Contrast Checker

  1. Type a colour such as #1a73e8, rgb(26, 115, 232) or hsl(217, 80%, 51%).
  2. Optionally type a second colour to compare contrast.
  3. Read the converted values and the contrast result, and copy what you need.

Good to know

  • HSL values are rounded to whole numbers, so converting back may differ by one step.
  • The contrast ratio follows the WCAG 2 formula. AA needs 4.5:1 for normal text and 3:1 for large text; AAA needs 7:1 and 4.5:1.
  • WCAG is a guideline. A pass does not guarantee that a design is accessible to everyone.
  • Colour names such as red are not read. Use a HEX, RGB or HSL value.

Frequently asked questions

What contrast ratio do I need?

For normal text, WCAG AA asks for at least 4.5 to 1 and AAA asks for 7 to 1. Large text needs 3 to 1 for AA.

Does it handle transparency?

Yes. A fourth value or an 8 digit HEX code is read as alpha and shown in the results.

Is my colour stored?

No. Everything stays in your browser.