HSL to Hex Converter

Enter hue (0–360), saturation, and lightness (0–100%) to get the matching hex color code. The result updates live as you type and copies in one click. Going the other way? Use the hex to HSL converter.

HSL → Hex

#2e6b50

Need hsl() values from a hex code instead? Use the hex to HSL converter.

Got your hex code? Generate its full range of tints and shades with the free HexTints generator, or look it up in the color library for precomputed values and WCAG contrast notes.

What HSL Is

HSL describes a color by three intuitive knobs instead of three light channels. Hue is an angle on the color wheel from 0° to 360° — 0° is red, 120° green, 240° blue, and the wheel wraps back to red at 360°. Saturation is intensity: 0% is gray, 100% is the most vivid version of that hue. Lightness runs from 0% (black) through 50% (the pure color) up to 100% (white).

That structure is what makes HSL so useful for systematic palettes: keep hue fixed and step lightness to build a ramp, or nudge lightness a few points for hover and active states. The lighten color and darken color tools automate exactly that move and hand you the final hex.

How HSL to Hex Conversion Works

The conversion goes through RGB. From saturation and lightness the algorithm computes a chroma value (how far the channels spread apart), the hue angle's 60° sector decides which of red, green, and blue get the high, middle, and low values, and a lightness offset shifts all three. Scale the results to 0–255 and write each channel in base 16 — that's your hex code.

hsl(153, 40%, 30%)  →  rgb(46, 107, 80)  →  #2E6B50

CSS note: you often don't need to convert at all — background: hsl(153 40% 30%) is valid CSS in every modern browser. The hex form matters for design tokens, emails, and tools that only accept hex.

Example HSL → Hex Values

HSLHexColor
hsl(0, 100%, 50%)#FF0000Red
hsl(120, 100%, 25%)#008000Green
hsl(240, 100%, 50%)#0000FFBlue
hsl(153, 40%, 30%)#2E6B50Forest green
hsl(153, 40%, 60%)#70C29DPastel green
hsl(210, 29%, 24%)#2B3D4FSlate navy

Notice the two greens: same hue and saturation, different lightness — one number turns a dark brand color into a pastel. Prefer picking visually? The color picker shows hex, RGB, and HSL side by side as you drag.

Frequently Asked Questions

Related tools: hex to HSL · hex to RGB · RGB to hex · color picker · tint & shade generator

Got your hex code? Put it to work on a page that's yours — create your free MinglyLink page →