ToolConvoyToolConvoyv2.6
MISC

HSL to HEX — Convert HSL Color Values to HEX Codes

Convert HSL colors to HEX codes. Hue, saturation, and lightness to a six-digit hex string — runs entirely in your browser, no upload.

● LOCAL · BROWSER-ONLY0 network requests since page load

HSL to HEX

Convert HSL color values to HEX color codes online. Enter HSL like 30,100,50 and get hex. Works entirely in your browser.

HSL is the most intuitive color model for humans to reason about. Three independent axes, each with a clear meaning: hue is the angle around the color wheel, saturation is how much pigment versus gray, and lightness is how close to black or white. Designers reach for HSL when they’re picking a palette because adjusting one axis at a time produces predictable results — pull saturation down to desaturate, push lightness up to lighten, rotate hue to shift family. Hex is what almost every design tool actually saves. Figma, Sketch, Photoshop’s swatch panel, CSS variables, the Tailwind config — they all store colors as six hex digits, sometimes with a two-digit alpha suffix.

The mismatch is why HSL-to-HEX conversion is one of the more common small chores in front-end work. The conversion itself is a few lines of arithmetic. The conversion gets interesting at the edges: the gamma correction between perceptual lightness and the sRGB encoding that hex implicitly assumes, the rounding to the nearest 8-bit value per channel, and the question of what the input HSL even represents (a CSS string, three bare numbers, a design tool’s swatch, a screenshot eyedropper). This tool handles the three common input shapes and shows the rounded result next to the exact arithmetic, so the difference between ‘the value I want’ and ‘the value I get’ is visible in the preview swatch.

For most uses, the right next step after a successful HSL-to-HEX is to drop the result into a design system as a token, or to write a one-line CSS custom property. If you need the inverse — a hex value someone handed you, and you want to tweak it in HSL — the hex-to-hsl converter on this site reads the hex back into the same three sliders, so the round trip is two clicks. For named colors, accessibility checks (WCAG contrast), or extracting a palette from an uploaded image, those are different tools in the same family.

How to use

  1. Enter H, S, L values

    Type the three values or drag the three sliders. Hue wraps at 360, saturation and lightness are percentages from 0 to 100.

  2. Copy the HEX result

    The six-digit hex code appears immediately. Add a # prefix only if your design tool requires it — most modern CSS and Figma accept either form.

  3. Compare with the RGB preview

    The RGB and HSL readouts are shown side-by-side so you can spot rounding when the conversion is one or two units off from what you typed in another tool.

Frequently asked

Why does the result round to the nearest integer?

HEX is an 8-bit-per-channel format, so any fractional HSL value must be quantised to one of 256 steps. Sub-1% saturation or lightness differences disappear in the conversion by design.

Does this preserve alpha transparency?

No. The output is always 6 digits (RRGGBB). For 8-digit hex with alpha, use the dedicated color-converter tool which exposes the alpha channel separately.

What's the difference between HSL and HSV?

HSV (hue, saturation, value) peaks brightness at V=100. HSL (hue, saturation, lightness) peaks at L=50. They share the hue and saturation meaning but treat the third axis differently. Designers tend to prefer HSL because the lightness axis maps more directly to how the eye perceives a color.

Can I paste a CSS hsl() string?

Yes. The input field accepts the full CSS hsl(210, 50%, 40%) form, the comma-free hsl(210 50% 40%) form, and bare numbers 210 50 40. All three are parsed to the same result.

Limitations

  • sRGB onlyHEX implicitly means sRGB. Wide-gamut colors in Display P3 or Rec.2020 will be clipped on conversion. Use a color-profile-aware tool if you need to preserve the gamut.
  • No named colorsThe output is a hex code, not a name. 'rebeccapurple' and the other 147 CSS named colors are not exposed. A reverse lookup table is a separate tool.
  • Linear vs gamma confusionHEX assumes sRGB-encoded (gamma-corrected) values. If your source HSL was derived from linear RGB, the result will look slightly darker than expected when displayed.

Platform notes

macOS
Digital Color Meter (in /Applications/Utilities) reports values in sRGB and shows you the equivalent hex on screen — useful for verifying a conversion visually.
Windows
PowerToys' Color Picker (Win+Shift+C) pastes any color as hex with the # prefix. Use it to confirm a conversion result before pasting into your design file.
Linux
GIMP's color picker shows hex in the foreground/background color boxes. Theeyedropper also reports HSL, so you can round-trip a color through GIMP to verify.
Web
All major browsers ship a native color picker on the color input element, which always shows the sRGB hex. Use it as a sanity check on conversions.

Related tools