Color Converter
Convert colors between HEX, RGB, and HSL formats.
RGB
HSL
Last updated:
Convert colors between HEX, RGB and HSL
This color converter turns one color value into the other two formats. Change the color in any one place and HEX, RGB and HSL all update together, with a live preview swatch. You can then copy the format your CSS needs.
How to use it
- Type a HEX code into the HEX box, or click the color picker square, or choose one of the 10 preset swatches.
- Or move the R, G, B sliders (0–255) or the H, S, L sliders (hue 0–360, saturation and lightness 0–100).
- Read the three output rows: HEX, RGB and HSL.
- Click Copy beside the format you want.
How it works
HEX is split into red, green and blue values. RGB is converted to HSL with the standard formula, and HSL back to RGB the same way. HSL numbers are rounded to whole numbers, so converting back and forth can shift a channel by one step.
What you see
| Output | Example |
|---|---|
| HEX | #C8522A |
| RGB | rgb(200, 82, 42) |
| HSL | hsl(15, 65%, 47%) |
Assumptions and limits
- Input is 3-digit or 6-digit hex, with or without the
#. A 3-digit code such as#f80is expanded to#ff8800. - Only HEX, RGB and HSL are supported. There is no alpha channel, CMYK or named-color input.
- Invalid hex shows a short message and leaves the last valid color in place.
Frequently asked questions
Can I enter an RGB or HSL value directly as text?
Not as text. For RGB you type numbers into the three number boxes or use the sliders. For HSL you use the sliders. HEX is the only format with a text input.
Why does my HSL value look slightly different after converting back?
HSL is rounded to whole numbers. That small rounding can change one RGB channel by a step when you convert again.
Does it support transparency?
No. The tool handles opaque colors only, so 8-digit hex and rgba() values are not supported.
Related Text Tools
Browse all tools from the same category.
Word Counter
Words, characters, sentences, and paragraphs
Open toolText Case Converter
Upper, lower, title, and sentence case
Open toolShowing 1-2 of 27