CleverCat mascot: a cat engineer with a hard hatCleverCat.CC

Home / CSS & color / HEX to RGB Converter

HEX to RGB Converter

Design tools speak HEX, CSS often wants RGB, and adjusting a shade is easiest in HSL. Enter a colour in any of them and see all three, plus the contrast ratio against white and black text.

How to use it

  1. Use the picker, or type a HEX or RGB value.
  2. Read the other formats and the two contrast ratios.
  3. Copy the format your code needs.

Examples

Questions people ask

What do the contrast numbers mean?

They compare this colour against white and against black. WCAG asks for at least 4.5:1 for normal text and 3:1 for large text, so the higher of the two numbers tells you which text colour to place on this background.

When is HSL more useful than HEX?

Whenever you are building a palette. Keeping hue and saturation fixed and changing only lightness gives a coherent set of tints and shades, which is very hard to do by nudging hexadecimal digits.

Related tools

Updated: 2026-08-07