How to use the HEX to RGB and HSL Converter
Use the color picker or enter 3 or 6 hexadecimal digits, optionally prefixed with #. View the RGB and HSL values together. Invalid HEX input hides the preview and disables copying. The picker keeps the last valid color; choosing a new color replaces the invalid input.
Example usage
#3366FF is RGB(51, 102, 255). Colors entered as 3 digits, such as #fff, are expanded to 6 digits.
Please note
This tool handles opaque sRGB colors. 4-digit and 8-digit HEX with alpha channel are not supported.
Step-by-step instructions
- Enter a HEX value such as #3366FF, or use the color picker.
- Check the color preview and RGB·HSL values.
- Copy the result to take the necessary values, such as CSS.
Three color expressions
HEX displays RGB channel values in hexadecimal, and RGB represents red, green, and blue with values from 0 to 255, respectively. HSL is expressed in terms of hue angle, saturation, and brightness. This tool is based on opaque sRGB and HSL values are rounded to the nearest whole number. It does not check color contrast or CMYK conversion for printing.
| HEX | RGB | HSL |
|---|---|---|
| #3366FF | 51, 102, 255 | 225°, 100%, 60% |
| #FFFFFF | 255, 255, 255 | 0°, 0%, 100% |
| #000000 | 0, 0, 0 | 0°, 0%, 0% |
Frequently Asked Questions
Are #fff and #ffffff the same color?
Yes. Repeat each character of the three-digit HEX twice to expand it to six digits.
Can colors include transparency?
Currently, only 3-digit and 6-digit HEX are supported. Alpha channels of 4-digit and 8-digit HEX and rgba are not processed.
When converted back to HSL, the values are slightly different.
HSL on screen rounds to integers. Keep the original HEX as repeated conversions may result in small differences.
Created and operated by: Moyoutil · Content review: 2026-10-01 · Error report