What this tool does
Choose a colour with the picker or type a six-digit HEX code. The tool shows the same colour as RGB and HSL values, ready to copy into CSS or a design app.
Pick a colour or type a HEX code and get the matching RGB and HSL values for CSS, design tools and brand guides.
Choose a colour with the picker or type a six-digit HEX code. The tool shows the same colour as RGB and HSL values, ready to copy into CSS or a design app.
#3459EC, the blue used on this site, converts to rgb(52, 89, 236) and hsl(228, 83%, 56%). 34 in hex is 3×16 + 4 = 52, which is the red value.
HSL makes it easy to build variations of a colour. Keep the hue and saturation and change lightness to get a lighter tint for backgrounds or a darker shade for hover states: hsl(228, 83%, 90%) is a pale version of the same blue. In RGB you would have to change all three numbers.
For readable text, the contrast between text and background should be at least 4.5:1 for normal text under WCAG guidelines. Light blues and greys on white often fall short. Use a contrast checker before finalising brand colours for text.
Only six-digit HEX codes are read. Three-digit shorthand such as #FFF should be expanded to #FFFFFF, and alpha (transparency) values are not supported.
Split the code into three pairs and convert each from hexadecimal to decimal.
Expand it to #FFFFFF first.
No, only opaque colours.
Both use hue, but HSL’s lightness runs from black through the pure colour to white, while HSV’s value runs from black to the pure colour.
All three work. HSL is easiest for making variations; HEX is the most compact.