Color Converter
Convert any color between HEX, RGB and HSL formats.
#8B5CF6
rgb(139, 92, 246)
hsl(258, 90%, 66%)
Convert a color between the three formats you use most: HEX, RGB and HSL. Enter a value in any format or pick one visually, and see all three update live alongside a color swatch, so you never have to translate a colour by hand when a design tool, a stylesheet and a brand guide each speak a different format. It is handy for design and CSS work, because a colour copied from a mockup is often in HEX while your code needs RGB, or a designer describes a shade in HSL terms that a developer must turn into a usable value. A manual conversion is easy to get wrong by a few digits, which changes the colour on screen. Seeing all three formats together, with the swatch as proof, removes that risk. It runs entirely in your browser.
Three ways of writing the same colour
HEX, RGB and HSL all describe identical colours in different notation. HEX is compact and dominates CSS and design free online tools. RGB states the red, green and blue channels directly, which is what you need when a value has to be calculated or animated. HSL describes hue, saturation and lightness, which maps far better onto how people actually think about colour, which is why it is the easiest one to adjust by hand.
HSL is the one worth learning
If you want a slightly darker version of a colour in HEX, you have to guess and check. In HSL you keep the hue and saturation and lower the lightness, and you get exactly what you expected. Building a palette works the same way: hold saturation and lightness steady and rotate the hue to get colours that belong together. This is why design systems are usually authored in HSL even when they ship as HEX.
Things that trip people up
- HEX shorthand like #fff is the same as #ffffff, with each digit doubled.
- An eight digit HEX carries alpha transparency in the last two digits.
- RGB channels run 0 to 255, while HSL uses degrees for hue and percentages for the rest.
- Converting between these three is exact and lossless, unlike converting to print colour spaces such as CMYK.
How to use Color Converter
- 1
Enter a color or pick one with the swatch.
- 2
See the HEX, RGB and HSL values.
- 3
Copy the format you need.
Frequently asked questions
HEX, RGB and HSL, all kept in sync as you edit any one of them.