What does HSL mean? Hue, saturation and lightness explained
By TechCompare · Updated · How we check
Use HSL when you adjust a color by hand or build variations in code, like hover states and dark mode variants. Use hex or rgb() for static colors you copy between tools, and look at oklch() when a scale has to look even across hues.
Drag a slider, or type a number, and the swatch, HSL, hex and RGB change together.
- HSL
hsl(220, 80%, 55%) - HEX
#306EE8 - RGB
rgb(48, 110, 232)
HSL is a color written as three numbers: hue, saturation and lightness. Hue is the base color as an angle on a 0-360 degree wheel, where 0 is red, 120 is green and 240 is blue. Saturation runs from 0% (gray) to 100% (vivid). Lightness runs from 0% (black) through 50% (the pure hue) to 100% (white). The demo above starts at #306EE8, which is hsl(220, 80%, 55%). That's a blue at hue 220, with 80% saturation and 55% lightness. Drag a slider and the hex and RGB values follow.
Common colors in HEX, RGB and HSL
| Color | HEX | RGB | HSL |
|---|---|---|---|
| Red | #FF0000 | rgb(255, 0, 0) | hsl(0, 100%, 50%) |
| Orange | #FFA500 | rgb(255, 165, 0) | hsl(39, 100%, 50%) |
| Yellow | #FFFF00 | rgb(255, 255, 0) | hsl(60, 100%, 50%) |
| Lime | #00FF00 | rgb(0, 255, 0) | hsl(120, 100%, 50%) |
| Cyan | #00FFFF | rgb(0, 255, 255) | hsl(180, 100%, 50%) |
| Blue | #0000FF | rgb(0, 0, 255) | hsl(240, 100%, 50%) |
| Magenta | #FF00FF | rgb(255, 0, 255) | hsl(300, 100%, 50%) |
| Maroon | #800000 | rgb(128, 0, 0) | hsl(0, 100%, 25%) |
| Gray | #808080 | rgb(128, 128, 128) | hsl(0, 0%, 50%) |
How HSL works and when to use it
Read the HSL column of the table from top to bottom. The pure colors all sit at 100% saturation and 50% lightness, and only the hue changes: 0 for red, 39 for orange, 60 for yellow, 120 for lime, 180 for cyan, 240 for blue and 300 for magenta. Maroon is red with its lightness cut to 25%. Gray has 0% saturation, so its hue number doesn't matter. Try the gray case in the demo: pull Saturation to 0 and the hue slider stops changing the color.
Pick the format for the job:
- Hex for a color you paste between design tools, docs and code. It's short, and nearly every tool reads it.
rgb()when you work on the channels themselves, like mixing two colors or reading a pixel.hsl()when a person tunes a color by hand, or code builds variations from one base color, like hover, active and disabled states.oklch()when a scale has to look evenly spaced across hues, since HSL isn't perceptually uniform.- CMYK only for print. See RGB vs CMYK for why those numbers come from a formula and not a print preview.
HSL's main strength is that you can reason about color relationships in your head. Want a lighter version of a color? Raise the L value. Want a more muted version? Lower S. Want a complementary color? Add 180 to H and wrap at 360. These mental operations are much harder in RGB or hex. That makes HSL a good fit for programmatic color generation, design system token derivation, and dynamic theming.
In CSS the syntax is hsl(H S L), or hsl(H S L / A) with alpha. CSS Color Level 4 added the modern comma-free form, so hsl(220 80% 55% / 0.6) is valid in all modern browsers as of 2026. The older comma form, hsl(220, 80%, 55%), still works too. A common pattern in design systems is to derive hover and disabled states from a base brand color: a button at hsl(220 80% 55%) becomes hsl(220 80% 45%) on hover and hsl(220 70% 65%) when disabled. On hover only the lightness changes, which makes the relationship visible to the next engineer reading the code. Drag Lightness to 45 in the demo to see that hover color.
HSL is rounded to whole numbers here, so a hex code can come back a step off after a trip through HSL. Here #306EE8 is hsl(220, 80%, 55%), and that turns back into #306EE8, so the demo's starting color survives the trip. Not every color does: #B736CB is hsl(292, 59%, 50%), and that turns back into #B734CB. Keep the hex code as the master copy and use HSL to adjust it.
The main limitation of HSL is that it isn't perceptually uniform. A lightness value of 50% maps to very different perceived brightness for yellow (which looks much brighter) versus blue (which looks darker), and saturation at 100% maps to different perceived intensity across hues. This is why modern CSS also offers lch(), the cylindrical form of CIELAB (CIE LCH), and oklch(), the cylindrical form of Oklab (OkLCh). These distinct spaces offer more perceptually useful lightness and chroma controls than HSL for many color-scale workflows. For static, hand-picked colors HSL is fine. For auto-generated scales, dark mode variants, and accessibility-critical contrast work, OKLCH is usually the better choice in 2026.
Verdict
Use HSL when a person or a script adjusts a color. One or two numbers give a lighter, darker or more muted version, and the hue stays put. Keep hex as the format you store and share, and switch to OKLCH or lch() for evenly spaced scales.
The catch is that HSL isn't perceptually uniform. A lightness of 50% looks much brighter in yellow than in blue, so an HSL scale with equal steps won't look evenly spaced. OKLCH and lch() are built to be more even, which is why they suit design tokens, dark mode variants and accessibility checks. For a hand-picked color that doesn't change, HSL is fine.
More Color scenarios
Related guides
Frequently asked questions
What does HSL mean?
Why does the hue slider stop changing the color?
Is HSL better than hex?
What's the difference between HSL and HSI?
Should I use HSL or OKLCH for new projects?
Related tools
Contrast Checker
Check color contrast ratios for WCAG AA/AAA accessibility compliance.
Use toolJSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolAspect Ratio Visualizer
Visually compare width differences between 16:9, 21:9, and 32:9 monitors.
Use tool