Color Converter (HEX, RGB, HSL)

Convert colors between HEX, RGB, HSL and CMYK with a live preview and contrast check.

Converter

Was this tool useful?

About this tool

About Color Converter (HEX, RGB, HSL)

Pick a color or type any format to get every other format, plus contrast ratio against white and black.

How it works

Contrast ratio = (L1 + 0.05) ÷ (L2 + 0.05), where L is relative luminance (WCAG 2.x).

Example

#4F46E5 = rgb(79, 70, 229) = hsl(243, 75%, 59%). Contrast with white = 6.29:1 (passes AA).

How to use this tool

  1. Type a color in any format or use the color picker.
  2. See all formats update.
  3. Copy the value you need.

Frequently asked questions

What contrast is needed for accessibility?

WCAG AA needs 4.5:1 for normal text and 3:1 for large text.

Is CMYK exact?

No. It is a simple conversion; print colors depend on the printer profile.

Does the Color Converter (HEX, RGB, HSL) send my data to a server?

No. The Color Converter (HEX, RGB, HSL) runs entirely in your browser using JavaScript, so tokens, code and data you paste stay on your device. You can even use it offline once the page has loaded.