HEX to HSL Converter
Convert a HEX color code into HSL, the format that describes color as hue, saturation, and lightness. HSL is often easier to reason about than HEX or RGB because you can lighten a color by raising lightness or shift its mood by rotating hue. Paste any valid HEX, including 8-digit codes with alpha, and get the matching hsl() or hsla() value immediately, along with the RGB equivalent and nearest CSS color name for context. Input is validated with clear messages, and every value copies with one click. Because HSL is derived from RGB through a defined transform, converting back to HEX may differ by a unit due to rounding, which is expected and visually invisible.
| Format | Value | Copy |
|---|
How to use the HEX to HSL Converter
- Enter a HEX code. Paste a 3, 4, 6, or 8-digit HEX value.
- Read the HSL output. See hue in degrees and saturation and lightness as percentages, plus hsla() when alpha is present.
- Copy the result. Click copy to use the HSL value in your CSS.
Examples
- Brand blue: #3498db converts to about hsl(204, 70%, 53%).
- Lightening in HSL: Convert a color, then raise the lightness percentage to create a tint.
How it works
HSL is computed from RGB by finding the maximum and minimum channels: their midpoint gives lightness, their spread gives saturation, and the dominant channel sets the hue angle. Because these are real-number operations rounded for display, a round trip back to HEX can differ by a unit, which is normal.
Common use cases
- Adjusting a color’s lightness or hue directly in CSS
- Building tints and shades by changing only lightness
- Understanding the hue of a HEX code at a glance
Privacy
All color calculations run in your browser. Nothing you enter is sent to a server. Saved palettes and recent colors are kept only in your browser’s local storage and can be cleared at any time.
Frequently asked questions
What are HSL’s units?
Hue is an angle from 0 to 360 degrees, while saturation and lightness are percentages from 0 to 100.
Does it support alpha?
Yes. An 8-digit or 4-digit HEX produces an hsla() value with the alpha channel.
Why does converting back to HEX change a digit?
HSL uses real numbers that are rounded for display, so the round trip can shift a channel by one unit. The difference is invisible.
Is HSL better than HEX?
Neither is better; they describe the same color. HSL is just easier when you want to adjust lightness or hue directly.