🎨Color Converter

Type a colour in any format or use the picker. Copy it as HEX, RGB, HSL or a CSS variable, and check whether white or black text is readable on it.

How to use the color converter

  1. Enter a colour (#hex, rgb() or hsl()) or use the picker.
  2. Copy the format you need.
  3. Check the contrast boxes for readable text colours.

Frequently asked questions

›How do I convert HEX to RGB?

Split the 6-digit hex code into three pairs and convert each from base 16. #4F46E5 → 4F=79, 46=70, E5=229 → rgb(79, 70, 229).

›What is a good contrast ratio?

WCAG AA requires at least 4.5:1 for normal text and 3:1 for large text. AAA requires 7:1.

›What is HSL?

Hue (0–360° around the colour wheel), Saturation (%) and Lightness (%). It's easier than RGB for making lighter or darker shades.