Home › Converters › Hex to HSL

Hex to HSL

Your stylesheet, brand guide or design token is written as a hex code, but the change you need to make — "same color, a bit lighter", "same hue, less vivid" — is an HSL kind of change. This hex to hsl converter translates any hex code into its hue, saturation and lightness, shows the RGB values and a live swatch, and offers one-click copying for every format. A reverse mode underneath turns HSL values back into a hex code.

hsl(11, 100%, 60%)
rgb(255, 87, 51) · #FF5733

Convert HSL back to hex

#FF5833
rgb(255, 88, 51) · hsl(11, 100%, 60%)

How it works

A hex code is RGB in disguise: the three pairs are the red, green and blue channels in base 16, each from 00 to FF. HSL describes the same color the way people think about it — hue picks the family on a wheel, saturation sets the vividness, lightness sets the brightness. Converting means scaling the channels to 0–1, then comparing the strongest and weakest of the three.

Lightness L = (max + min) ÷ 2  |  Saturation S = (max − min) ÷ (max + min) when L < 50%, else (max − min) ÷ (2 − max − min)  |  Hue H = 60 × the segment formula for whichever channel is max (red, green or blue)  |  Reverse: chroma C = (1 − |2L − 1|) × S, then channel = (segment value + L − C ÷ 2) × 255

Hue is an angle, which is why red lives at both ends of the scale: 0° and 360° are the same red, with orange near 30°, yellow at 60°, green at 120°, blue at 240° and magenta at 300°. Saturation and lightness are percentages. At 0% saturation the channels are equal and the color is a grey regardless of hue — the converter reports hue 0 for greys by convention, since there is no direction on the wheel to point to. The reverse mode runs the chroma formula: given a hue sector, it rebuilds the three channels and rounds them to whole numbers for the hex code.

Worked example

A designer in Austin is handed a brand accent, #FF5733, and asked for a lighter hover state — a job that starts with knowing the color's HSL.

Step 1: Split the hex into channels — FF, 57, 33 — which are 255, 87 and 51 in decimal.
Step 2: Scale to 0–1: red 1.0, green 0.341, blue 0.2. The max is 1.0, the min is 0.2.
Step 3: Lightness = (1.0 + 0.2) ÷ 2 = 0.6, so 60%.
Step 4: Saturation = (1.0 − 0.2) ÷ (2 − 1.0 − 0.2) = 0.8 ÷ 0.8 = 100% — fully vivid.
Step 5: Red is the max, so hue = 60 × ((0.341 − 0.2) ÷ 0.8) = 60 × 0.1765 ≈ 10.59°, which rounds to 11°.

The converter shows hsl(11, 100%, 60%) — an orange-red at full saturation. For the hover state she can now raise lightness toward 70% and keep hue and saturation untouched, something that would take three coordinated guesses in RGB.

Common mistakes and tips

The most common surprise is the round trip: HSL displayed here is rounded to whole numbers, so converting hsl(11, 100%, 60%) back yields #FF5833, one step of green away from #FF5733, because the true hue was 10.59°. Keep hex as the master value for brand colors. The second trap is the 3-digit shorthand: #F53 is CSS shorthand for #FF5533, not #FF5733 — similar-looking oranges that are not the same color. And note that HSL lightness is not perceived brightness: yellow and blue at the same lightness look very different in weight, which is why the live swatch matters more than the numbers when judging a palette.

FAQ

What is #FF5733 in HSL?

#FF5733 is hsl(11, 100%, 60%). The hex code is rgb(255, 87, 51): the brightest channel is 1.0 and the dimmest 0.2 after scaling, giving a lightness of 60%, full saturation, and a hue of about 11 degrees — a vivid orange-red.

How do I convert hex to HSL by hand?

Split the hex code into its red, green and blue pairs and divide each by 255. Lightness is the midpoint between the largest and smallest channels. Saturation compares the gap between them, and hue is the angle around the color wheel, worked out from whichever channel is largest. The step-by-step example on this page walks through #FF5733.

What do H, S and L stand for?

Hue, saturation and lightness. Hue is the color family, an angle from 0 to 360 (0 and 360 are red, 120 is green, 240 is blue). Saturation is how vivid the color is, from grey at 0% to full color at 100%. Lightness runs from black at 0% through the pure hue at 50% to white at 100%.

Can I convert HSL back to hex exactly?

Almost always — but remember that this page rounds the HSL figures to whole numbers. Converting a rounded hsl(11, 100%, 60%) back gives #FF5833, a whisker away from the original #FF5733, because the exact hue was 10.59 degrees. Keep the hex code as your master copy when a brand color must match perfectly.

Why does my grey or black color show hue 0?

Greys have no hue to measure: when all three channels are equal, saturation is 0% and the hue is undefined, so converters report 0 by convention. Black is hsl(0, 0%, 0%), white is hsl(0, 0%, 100%), and every grey sits between them at 0% saturation.

Disclaimer: Results are conversions for guidance only. HSL values are rounded to whole numbers for display; for legal, medical, or safety-critical use, confirm with an official source or a qualified professional.