Enter a color

°
%
%
#3B82F6
 
  • HEX
  • HSL
  • RGB
  • HSB
  • HSV
  • CMYK

Contrast & Accessibility WCAG ratio of this color used as text

Aa on white
Aa on black

Shades & Tints click any swatch to load it

Shades (toward black)
Tints (toward white)

Color Harmonies based on the current Hue

Complementary
 
Analogous
  
Triadic
  
Split Complementary
  
Tetradic
   

About the HSL to HEX Converter

What is HSL to HEX conversion?

HSL describes a color by its Hue (which color, 0–360°), Saturation (how vivid, 0–100%), and Lightness (how light or dark, 0–100%). A HEX code is the six-character form that goes into most design tools and stylesheets. This converter takes an hsl() value, works out the red, green, and blue behind it, and gives you the matching HEX code, along with the RGB, HSB/HSV, and CMYK equivalents and a live preview.

It's the tool to reach for when you have an HSL value — maybe from a CSS file or a color you dialed in with the sliders — and you need the plain HEX that a logo tool, an icon set, or a teammate is asking for. Drag the Hue, Saturation, and Lightness sliders and watch the HEX update live, or type a HEX to go the other way. Everything runs in your browser, so it's instant and your colors stay private.

How to Use This Tool

  1. Set your HSL color. Drag the Hue, Saturation, and Lightness sliders, or type exact numbers into the boxes beside them.
  2. Read the HEX code. The matching six-digit HEX appears at the top of the results and updates the instant you move a slider.
  3. Or start from HEX. Paste a HEX code, use the swatch picker, or grab a color with the eyedropper, and the HSL sliders snap to match.
  4. Explore and copy. Click any swatch in the shades, tints, or harmony rows to load it, then tap the copy button beside whichever value you need.

Common Use Cases

Going from HSL back to HEX comes up all the time once you start working in HSL:

  • Exporting for design tools: Photoshop, Figma, and most logo makers want a HEX code, so convert your CSS HSL value before pasting it in.
  • Sharing a color: HEX is the universal shorthand, so it's the easiest form to drop into a message, a ticket, or a brand doc.
  • Locking in a tweak: Adjust Lightness or Saturation to get a shade just right, then grab the HEX for your assets.
  • Building a palette: Step the Hue around the wheel and collect the HEX codes for a fresh, balanced color scheme.
  • Checking contrast: The accessibility panel shows how your color scores as text on white and black against WCAG levels.

Need the reverse, or another model? Use our HEX to HSL converter, the RGB to HEX converter, or the HSB to HEX converter.

Frequently Asked Questions

How do I convert an HSL value to HEX?

Enter your Hue, Saturation, and Lightness with the sliders or number boxes and the HEX code appears instantly at the top of the results. Under the hood the tool turns HSL into RGB, then writes each channel as a two-digit hexadecimal number to form the #RRGGBB code.

Why would I store colors in HSL if I need HEX?

HSL is much easier to adjust by hand — you can lighten a color or tone it down by changing a single number — so many people design in HSL and convert to HEX only when a tool or file needs it. This converter makes that final step a one-click job.

Is the HEX code from HSL exact?

It's exact for the HSL numbers you enter. The only rounding happens because each channel becomes a whole 0–255 value, which is how HEX works. Convert that HEX back to HSL and you may land a step away if your original HSL used in-between values, but the visible color is identical.

Does HSL support an alpha (transparency) value?

Yes, in CSS you can write hsl(217 92% 60% / 0.5) for 50% opacity, but standard six-digit HEX has no alpha channel. If you need transparency in HEX, you'd use the eight-digit #RRGGBBAA form; this tool focuses on the solid color.

Can I also get RGB and CMYK from my HSL color?

Yes. Alongside the HEX code the results list shows the same color as RGB, HSB/HSV, and CMYK, each with its own copy button, so you can grab whichever format your next tool expects.

Is this tool free and private?

Completely. There's no sign-up and no limit, and every conversion runs in your browser with JavaScript, so the colors you enter are never uploaded or logged. It keeps working offline once the page has loaded.

@verbatim @endverbatim