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.

°
RedGreenBlueRed
%
GrayVivid
%
BlackPure colorWhite

Drag a slider, or type a number, and the swatch, HSL, hex and RGB change together.

  • HSLhsl(220, 80%, 55%)
  • HEX#306EE8
  • RGBrgb(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

ColorHEXRGBHSL
Red#FF0000rgb(255, 0, 0)hsl(0, 100%, 50%)
Orange#FFA500rgb(255, 165, 0)hsl(39, 100%, 50%)
Yellow#FFFF00rgb(255, 255, 0)hsl(60, 100%, 50%)
Lime#00FF00rgb(0, 255, 0)hsl(120, 100%, 50%)
Cyan#00FFFFrgb(0, 255, 255)hsl(180, 100%, 50%)
Blue#0000FFrgb(0, 0, 255)hsl(240, 100%, 50%)
Magenta#FF00FFrgb(255, 0, 255)hsl(300, 100%, 50%)
Maroon#800000rgb(128, 0, 0)hsl(0, 100%, 25%)
Gray#808080rgb(128, 128, 128)hsl(0, 0%, 50%)
Format
HSL
Example: #306EE8
Category
Web Formats
Color knowledge base

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

Hex to RGB
A hex color code is three RGB numbers written in base 16.
View details
RGB vs CMYK
Screens add light and print adds ink. See one color in both, and why a plain CMYK formula can't promise a print match.
View details
OKLCH in CSS
OKLCH (Lightness, Chroma, Hue) is a modern color space designed to be perceptually uniform, meaning that the same numerical change in a value produces roughly the same perceived change in color, regardless of the hue.
View details

Frequently asked questions

What does HSL mean?
HSL stands for hue, saturation and lightness. Hue is the base color as an angle from 0 to 360 degrees, saturation is how vivid it is from 0% (gray) to 100%, and lightness runs from 0% (black) to 100% (white). The example #306EE8 is hsl(220, 80%, 55%).
Why does the hue slider stop changing the color?
At 0% saturation the color is a gray, and a gray has no hue. The same happens at 0% and 100% lightness, which give black and white whatever the other two numbers say. The demo shows a short note when one of these cases is on.
Is HSL better than hex?
Not better, just different. Hex is more compact and universally copy-pasteable. HSL is more intuitive for making deliberate color adjustments. Use the one that matches your workflow.
What's the difference between HSL and HSI?
Both are cylindrical color models, but their third components use different formulas. HSL lightness is (max channel + min channel) / 2. Standard HSI intensity is the arithmetic mean (R + G + B) / 3, while weighted RGB averages describe luma or luminance rather than HSI. CSS uses HSL, not HSI, so most design tools you'll use are HSL.
Should I use HSL or OKLCH for new projects?
Use HSL when you need a quick mental model and your team is already comfortable with it. Use OKLCH for any work that generates color scales automatically, dark mode variants, or accessibility-driven palettes, because OKLCH is perceptually uniform and the same numeric step produces a consistent perceived change across hues. OKLCH is supported in all modern browsers since 2023.