Color converter
Convert color between the different formats (hex, rgb, hsl and css name)
About Color converter
Converts a colour between the notations used on the web and in design tools: hex, rgb(), hsl(), hwb(), lch(), cmyk() and the CSS colour names. Edit any field or use the picker, and every other format updates.
When you would use it
- Turning a hex code from a design file into the hsl() or rgb() a stylesheet uses.
- Finding the nearest CSS colour name for a hex value, or the hex value of a name such as rebeccapurple.
- Getting CMYK values to hand a web colour to a print designer, or LCH values for perceptually even palettes.
How to use it
- Type a colour in any field (for example #1ea54c, rgb(30, 165, 76) or seagreen), or pick one with the colour picker.
- All other fields update as soon as the input is a valid colour.
- Copy the format you need with its copy button.
Things worth knowing
- Hex accepts 3, 4, 6 and 8 digits; the 4- and 8-digit forms carry transparency, which rgb() and hsl() show as a fourth alpha value.
- CMYK here is a plain mathematical conversion from RGB, not a colour-managed one. Printed results depend on the paper, inks and ICC profile, so treat the numbers as a starting point.
- The name field shows a CSS colour name only when the colour matches one exactly; most colours have no name and the field stays empty.
- LCH and HWB are supported by current browsers in CSS, but older browsers ignore them, so keep a hex or rgb() fallback when you use them in stylesheets.
Frequently asked questions
- Why does the name field stay empty?
- Only the 148 named CSS colours have a name, and the match must be exact. #1ea54c is close to seagreen but is not seagreen, so no name is shown.
- Which format should I use in CSS?
- Hex is the most compact and universally supported. hsl() is easier to tweak by hand (lighter, darker, more saturated). Use the 8-digit hex or rgb() with alpha when you need transparency.