🎨

Color Converter

Convert colors between HEX, RGB, and HSL formats.

RGB

R
G
B

HSL

H15°
S65%
L47%
HEX#C8522A
RGBrgb(200, 82, 42)
HSLhsl(15, 65%, 47%)
About this tool

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

  1. Type a HEX code into the HEX box, or click the color picker square, or choose one of the 10 preset swatches.
  2. Or move the R, G, B sliders (0–255) or the H, S, L sliders (hue 0–360, saturation and lightness 0–100).
  3. Read the three output rows: HEX, RGB and HSL.
  4. 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

OutputExample
HEX#C8522A
RGBrgb(200, 82, 42)
HSLhsl(15, 65%, 47%)

Assumptions and limits

  • Input is 3-digit or 6-digit hex, with or without the #. A 3-digit code such as #f80 is 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.

More to explore

Related Text Tools

Browse all tools from the same category.

Showing 1-2 of 27