Developer tools TOOL
Color converter
Choose a color and view its HEX, RGB and HSL values.
Color converter · How to use
Choose a color and view its HEX, RGB and HSL values.
Example
#ff0000 → RGB(255, 0, 0) → HSL(0, 100%, 50%)
Things to know
Enter a color code or use the picker. Displayed colors can vary between screens.
Your files and results are never sent to a server. Everything is processed in this browser.
How to convert a HEX color code to RGB and HSL
Use it to move a HEX code from a design mockup into CSS rgb() or hsl() values, or to find the code for a color you picked on screen. Results update as soon as the color changes.
When to use this tool
- Turn a mockup HEX code into a CSS rgb() value
- Use HSL as a reference for lighter or darker shades
- Find the code of a color chosen with the picker
Step-by-step instructions
- Open the picker under Choose a color and select a color.
- If you already know the color, type # and six digits in the HEX field.
- Read the HEX, RGB and HSL values shown below.
- Choose Copy to copy all three values, one per line.
Frequently asked questions
Can I enter three-digit HEX like #fff or colors with transparency?
Only # followed by six hexadecimal digits is accepted. Write #fff as #ffffff; eight-digit HEX with alpha and rgba values are not supported.
Why might converting the HSL value back give a slightly different color?
Hue, saturation and lightness are rounded to whole numbers for display, so recalculating from them can shift the RGB channels slightly. Share the HEX or RGB value when the exact color matters.
Can I get the color of a spot in a photo?
This tool works with the picker and HEX input only. To click a point in a photo or screenshot and read its color, use the image color picker.