HSL to HEX

H
S
L

HSL to HEX Converter

Use this HSL to HEX converter to turn hue, saturation, and lightness values into a six-digit HEX color code. Set the three values, check the color in the preview box, and copy the code for your CSS, design file, or brand guide.

How to Use the HSL to HEX Color Converter

  1. Set the hue (H). Move the H slider or type a value in the box next to it.
  2. Set the saturation (S). Use the S slider or box to control how vivid the color is.
  3. Set the lightness (L). Use the L slider or box to make the color darker or lighter.
  4. Check the preview. The color box shows the color your values produce.
  5. Copy the code. The HEX code appears below the preview. Click Copy HEX to copy it.
  6. Start over. Click Reset to clear your changes and begin again.

Example

With H = 180, S = 50, and L = 50, the tool shows a soft teal and gives the HEX code #40BFBF.

What Do H, S, and L Mean?

HSL describes a color in three parts that match how people think about color:

  • Hue (H): The base color on a color wheel, from 0 to 360 degrees. Red is at 0, green at 120, and blue at 240.
  • Saturation (S): The intensity of the color, from 0% to 100%. A low value looks gray and a high value looks vivid.
  • Lightness (L): How light or dark the color is, from 0% to 100%. 0% is black, 100% is white, and 50% is the pure color.

What Is a HEX Color Code?

A HEX code is a six-digit value starting with #. The digits are three pairs that represent the red, green, and blue parts of the color. In #40BFBF, 40 is red, BF is green, and BF is blue.

Because the three parts are not easy to read, HEX is hard to adjust by hand. HSL is easier to tweak, and HEX is the format many tools and style sheets expect.

Common HSL to HEX Examples

HSLHEXColor
hsl(0, 100%, 50%)#FF0000Red
hsl(120, 100%, 50%)#00FF00Green
hsl(240, 100%, 50%)#0000FFBlue
hsl(180, 50%, 50%)#40BFBFSoft teal

Practical Tips for Choosing Colors

  • Build shades of one color. Keep H and S fixed and change only L. This gives you lighter and darker versions that belong together.
  • Make a color more muted. Lower S while keeping H and L the same. This works well for backgrounds.
  • Find neighboring colors. Shift H by 20–30 degrees to get colors that sit close to your main one on the wheel.
  • Try a contrasting color. Add 180 to your hue (or subtract 180 if the result goes over 360) to get the opposite color on the wheel.
  • Test readability. Very high or very low lightness can make text hard to read. Check your color against its background before using it.

When to Use This Tool

  • Converting a color from an HSL-based design tool into the HEX format your project requires
  • Picking a color visually with sliders, then copying the HEX code for CSS or HTML
  • Creating a set of related shades by adjusting one value at a time
  • Checking what HEX code matches an HSL value in a stylesheet

Frequently Asked Questions

Why does HSL feel easier to adjust than HEX?

In HSL, each value changes one clear property: the base color, its intensity, or its brightness. In HEX, changing one digit shifts the red, green, and blue mix in ways that are hard to predict.

Can two different HSL values give the same HEX code?

Yes. HEX uses whole numbers from 0 to 255 for each color channel, so very small HSL changes can round to the same result.

Is HSL the same as HSV or HSB?

No. They share hue, but their third value works differently. In HSL, 100% lightness is always white. In HSV or HSB, 100% brightness shows the full color. The same numbers in each model give different colors, so use HSL values here.

What happens at hue 0 and hue 360?

Both point to the same position on the color wheel, which is red. The wheel is a circle, so 360 wraps back to 0.

What HEX code do I get when saturation is 0%?

You get a shade of gray. With no saturation, the hue has no effect, and only lightness decides how dark or light the gray is.

What does the “#” mean in a HEX code?

It tells CSS and many design tools that the value is a HEX color. Copy the code with the # included when you paste it into your stylesheet.