Convert Hex to HSL CSS Color

Translate Hex #RRGGBB codes into Hue (0–360°), Saturation %, Lightness %, and modern CSS hsl() syntax locally.

0 bytes sent
  • 100% browser-local
  • Zero server transfers
  • CSS Color 4 precision

or drop a color string, CSS/JSON snippet, or file here · Ctrl V to paste · Paste Hex, RGB, HSL, OKLCH or use Screen Eyedropper

Instant Before & After Specimen

CSS HSL / HSLA
Input Samplecobalt.hex
#2563EB
Expected OutputHSL
hsl(221.2 83.2% 53.3%)

HEX vs HSL

Source vs. target format specification comparison
PropertySource: HEXTarget: HSL
Gamut scopesRGB (Standard Web)sRGB (Standard Web)
Perceptual uniformityNoNo
Alpha channel supportYesYes
Human readabilityMediumHigh
Extension / Token.css / .txt.css
Best forCompact copy-paste handoff in sRGB brand guidelines and legacy CSSLegacy CSS theme variables and simple single-hue mental tweaks in sRGB

How to use Hex to HSL

Hex to HSL — cleanly inside your local browser with zero server transfers.

  1. Enter or pick a colorType Hex, RGB, HSL, OKLCH, or Lab — or click Screen Eyedropper and live sliders.
  2. Inspect math & gamutReview exact CSS Color 4 readouts, sRGB vs Display P3 status, and profile options.
  3. Copy, chain, or exportCopy ready CSS/JSON snippets, download binary swatch files, or pipe directly to related Colr tools.

Frequently asked questions

Is HSL reliable for generating accessible 50–950 UI ramps?

HSL is great for single-hue tweaks, though OKLCH produces much more consistent WCAG contrast across yellow, green, and blue.

Does it preserve alpha from #RRGGBBAA inputs?

Yes — 4- and 8-digit hex inputs output modern hsl(H S% L% / A) strings.