Boneyard Tools

HEX to HSL Converter

Paste a hex code and read its HSL value instantly. HSL describes a color by hue, saturation and lightness, which makes tints, shades and related palettes far easier to build than juggling hex digits. A live swatch and a HEX, RGB, HSL comparison grid update as you type, and everything runs in your browser.

How to convert HEX to HSL

  1. Type or paste a hex code into the field, with or without the leading #.
  2. Or click the color swatch on the left to pick a shade visually.
  3. Read the HSL value shown as hue, saturation percent and lightness percent.
  4. Compare the HEX, RGB and HSL cards in the grid below to see all three formats.
  5. Click Copy to drop the hsl() string straight into your CSS or design tool.

Examples

Pure red

#ff0000
hsl(0, 100%, 50%)

Brand blue

#3b82f6
hsl(217, 91%, 60%)

Shorthand green

#0f0
hsl(120, 100%, 50%)

Frequently asked questions

What is HSL?

HSL stands for hue, saturation and lightness. It describes a color by its angle on the color wheel plus how vivid and how bright it is, which many people find more intuitive than a hex triplet. It is fully supported in CSS as the hsl() function.

What do hue, saturation and lightness mean?

Hue is an angle from 0 to 360 degrees, where 0 is red, 120 is green and 240 is blue. Saturation from 0 to 100 percent sets how vivid the color is, and lightness from 0 to 100 percent runs from black through the pure hue to white.

What hex formats does it accept?

Six-digit hex like #3b82f6 and three-digit shorthand like #0f0, with or without the leading hash. Shorthand is expanded by doubling each digit, so #0f0 becomes #00ff00 before conversion.

Why are the HSL numbers rounded?

Hue, saturation and lightness are each rounded to whole numbers so the output is short and pastes cleanly into CSS. The change is well under one unit and is not visible on screen. For example #3b82f6 resolves to hsl(217, 91%, 60%).

What happens with a gray color?

Grays are achromatic, so hue and saturation are both reported as 0 and only lightness changes. A mid gray like #808080 converts to hsl(0, 0%, 50%), since there is no dominant color to give it a hue.

Does it support alpha or 8-digit hex?

No. It handles the color channels only, so 8-digit hex with an alpha channel is rejected as invalid. Enter a 3- or 6-digit code and add any transparency separately in your CSS using hsla() or a slash alpha value.

What if I type an invalid code?

The tool shows an 'Invalid HEX color' message instead of a result until the code is a valid 3- or 6-digit hex. It also displays the matching RGB and hex values in the grid so you can double-check the color you meant.

Is my color sent to a server?

No. The conversion runs entirely in your browser, so your color values never leave your device.

How do I go the other way, from HSL back to hex?

Use the HSL to HEX converter for the reverse trip. The math is exact in both directions apart from the whole-number rounding, so a round trip usually lands on the same hex code.

Learn more

  • Using the HSL color model in CSS

    Why HSL makes tints, shades and palettes easier than hex, what each channel controls, and how rounding and grays behave when you convert.

Related tools