← All free tools Misc tools

HEXA to HSL

Convert your HEXA color format to HSL format.

Accepts any format: #a8d08d, rgb(168 208 141), hsl(96, 42%, 68%), hsv(96, 32%, 82%) or a color name.

About this tool

Type or paste a HEXA color, or choose one with the picker, and the converter shows it as HSL as you type, with a preview and every other format underneath, each with its own copy button. It reads colors written in any of the formats, and color names like “tomato”, too.

How to convert HEXA to HSL

A HEXA code is four pairs of base-16 digits: red, green, blue and alpha. In #a8d08dcc, a8 is 168 red, d0 is 208 green, 8d is 141 blue, and cc is 204, which is 204 ÷ 255 = 0.8 alpha. For HSL, divide each channel by 255 and take the largest and smallest of the three. The lightness is their average; the saturation is the gap between them, relative to the lightness; and the hue is an angle that depends on which channel is largest: red near 0, green near 120 and blue near 240.

HSL has no alpha, so the opacity is dropped and the color comes out fully solid.

The hue, saturation and lightness are rounded to whole numbers, so converting back can move a channel by one.

HEXA to HSL examples

ColorHEXAHSL
Sage green #a8d08dcc hsl(96, 42%, 68%)
Red #ff0000cc hsl(0, 100%, 50%)
Tomato #ff6347cc hsl(9, 100%, 64%)
Gold #ffd700cc hsl(51, 100%, 50%)
Dodger blue #1e90ffcc hsl(210, 100%, 56%)
Indigo #4b0082cc hsl(275, 100%, 25%)
Black #000000cc hsl(0, 0%, 0%)
White #ffffffcc hsl(0, 0%, 100%)

What is HEXA?

HEXA adds a fourth pair of digits to a HEX code for alpha, the opacity: ff is solid, 80 about half see-through and 00 invisible. All current browsers accept eight-digit codes in CSS.

What is HSL?

HSL describes a color by its hue (0 to 360 degrees on the color wheel), saturation and lightness. It’s easy to adjust by hand: keep the hue and change the lightness to get lighter and darker shades of the same color. CSS accepts it directly.

Have a project in mind?

Have a brand or a product to grow?