Hex to HSL Converter

Convert hex color codes to HSL and HSLA values instantly. Free color tool.

color hex hsl
Free Client-Side Private
🔒 This tool runs entirely in your browser — your files are never uploaded to any server.

Hex to HSL Converter is a fast, browser-based tool that translates hexadecimal color codes into HSL and HSLA values in one click. It is useful for front-end developers and UI designers who work with CSS color functions and need clean, ready-to-paste output without manual calculation.

Tool interface

The interface is focused and practical:

  • A color picker for choosing a color visually, paired with a hex input field for typing or pasting a code — the two stay in sync automatically
  • An Opacity slider (0–100%) for generating HSLA output with a custom alpha value
  • A Convert button that processes the input instantly
  • A color preview swatch showing the exact color at the selected opacity
  • An HSL output field with a Copy button for the hsl() CSS value
  • An HSLA output field (shown when opacity is below 100%) with its own Copy button
  • Three stat cards showing the individual Hue (°), Saturation (%), and Lightness (%) values
  • A Clear action to reset and start over

Tool description

The HSL color model — Hue, Saturation, Lightness — is more intuitive for human thinking about color than hex or RGB. Designers often adjust saturation and lightness to create tints, shades, and tones of a brand color, and CSS natively supports hsl() and hsla() for this reason. Hex to HSL Converter makes it easy to move a hex code from a brand guide or design tool into the HSL format your stylesheet uses.

The tool accepts all common hex formats:

  • 3-digit shorthand — e.g. #f0a expanded to #ff00aa
  • 6-digit standard — e.g. #3b82f6
  • 8-digit with alpha — e.g. #3b82f6cc (only the first 6 digits are used; opacity is handled by the slider)

When opacity is set to 100%, only the hsl() value is shown. Below 100%, the hsla() value also appears with the decimal alpha, keeping the output clean.

Common use cases:

  • Converting brand hex colors into hsl() values for CSS custom properties and design tokens
  • Generating hsla() values with custom opacity for overlays and backgrounds
  • Checking the hue, saturation, and lightness breakdown of any hex color
  • Building color scales by inspecting the lightness value and adjusting it systematically

How to use

  1. Type or paste a hex color code into the Hex color field, or click the swatch to open the visual color picker.
  2. Adjust the Opacity slider if you need an HSLA value with reduced transparency.
  3. Click Convert to see the result.
  4. Click Copy next to HSL or HSLA to copy the CSS-ready value.
  5. Review the Hue, Saturation, and Lightness breakdown in the cards below.
  6. Click Clear to reset and convert another color.

Tip: Hue is a degree on the color wheel (0°–360°). Red is near 0°, green near 120°, and blue near 240°. Saturation and lightness are percentages — 0% saturation gives a gray tone regardless of hue.

FAQ

Is Hex to HSL Converter free to use?

Yes. It is completely free and requires no account or installation.

What hex formats does it accept?

It accepts 3-digit (#rgb), 6-digit (#rrggbb), and 8-digit (#rrggbbaa) hex codes, with or without the leading #.

What is the HSL color model?

HSL stands for Hue, Saturation, and Lightness. Hue is the color angle on the wheel (0–360°), saturation controls color intensity (0% is gray, 100% is fully vivid), and lightness controls brightness (0% is black, 100% is white).

What does the Opacity slider do?

It controls the alpha value in the hsla() output. At 100% only hsl() is shown. Below 100% the tool also shows hsla() with the decimal alpha (e.g. 80% → hsla(h, s%, l%, 0.8)).

Does it send my data to a server?

No. All conversion happens locally in your browser using JavaScript. No data is sent anywhere.

Report an issue