Calculator and Converter

HEX to HSL converter

Type a hex colour code and this tool shows its hue, saturation and lightness, together with the CSS hsl value.

Results

Enter your values to see the result.

About this tool

HSL is easier to adjust than hex, because you can lighten or darken a colour by changing a single number.

How it is calculated
red, green and blue are scaled to 0-1; lightness = (max + min) / 2; saturation = (max − min) / (1 − |2 × lightness − 1|); hue is the angle on the colour wheel from the largest channel. Hue is in degrees, saturation and lightness in percent.
Worked example
With Hex colour: #FF8000, the result is: Hue: 30.1176 °; Saturation: 100 %; Lightness: 50 %; CSS: hsl(30, 100%, 50%).
Good to know
Red, green and blue are scaled to a range of 0 to 1, and the lightness is the average of the largest and smallest. The saturation and the hue follow from the standard formulas, with hue as an angle in degrees and saturation and lightness as percentages.

Frequently asked questions

What do hue, saturation and lightness mean?

The hue is the position on the colour wheel in degrees. Saturation is how intense the colour is, and lightness is how close it is to white or black.

Why use HSL instead of hex?

HSL is easier to adjust. To make a colour lighter or darker, change the lightness and keep the hue the same.

Related calculators