DevToolStation

Format & Convert

Colour Converter & Contrast

HEX, RGB, HSL and OKLCH conversion with WCAG contrast checks.

Loading the Colour Converter & Contrast…

About the Colour Converter & Contrast

Convert a colour between HEX, RGB, HSL and OKLCH, and check the contrast ratio of text against a background. Results are graded against WCAG 2.1 AA and AAA for normal text, large text and UI components, with a live preview.

How to use it

  1. Enter or pick a text colour and a background colour.
  2. Read the converted values for each.
  3. Check the contrast ratio and the pass/fail grades.

Frequently asked questions

What contrast ratio do I need?
WCAG 2.1 AA requires 4.5:1 for normal text and 3:1 for large text and UI components. AAA requires 7:1 and 4.5:1.
Are transparent colours supported?
Yes. A translucent text colour is composited over the background before contrast is measured.
Is anything uploaded?
No. Everything runs in your browser tab with JavaScript. Nothing you enter is uploaded, logged or stored, and the page works offline once loaded.