Enter the color
Type or paste a HSL code, or pick a color with the color picker.
Paste any HSL color and get its HEX value instantly, together with every other format: HEX, RGB, HSL, HWB, CMYK and OKLCH. Free, and it runs in your browser.
100% private — the calculation is done in your browser and nothing is sent to any server.
Keep going with your result in another tool. Nothing is uploaded.
Type or paste a HSL code, or pick a color with the color picker.
Every format updates as you type and shows a live preview of the color.
Use the copy button next to the format you need.
To convert HSL to HEX, enter your HSL color in the box above and read the HEX value next to it. For example, hsl(262, 83%, 58%) is #7C3BED. The result updates as you type, and every other format (HEX, RGB, HSL, CMYK and more) is shown at the same time.
HSL describes a color as hue (0 to 360 degrees around the color wheel), saturation (0 to 100 percent) and lightness (0 to 100 percent). It is easier to reason about than RGB: keep the hue and change the lightness to get lighter or darker shades of the same color.
A HEX color is a six-digit hexadecimal code with a # in front: two digits each for red, green and blue, from 00 to FF. In #3B82F6, red is 3B, green is 82 and blue is F6. A three-digit shorthand such as #38F repeats each digit, and eight digits add opacity at the end.
Here is the calculation for hsl(262, 83%, 58%), step by step:
| Color | HSL | HEX |
|---|---|---|
| Black | hsl(0, 0%, 0%) | #000000 |
| White | hsl(0, 0%, 100%) | #FFFFFF |
| Red | hsl(0, 100%, 50%) | #FF0000 |
| Lime | hsl(120, 100%, 50%) | #00FF00 |
| Blue | hsl(240, 100%, 50%) | #0000FF |
| Yellow | hsl(60, 100%, 50%) | #FFFF00 |
| Cyan | hsl(180, 100%, 50%) | #00FFFF |
| Magenta | hsl(300, 100%, 50%) | #FF00FF |
| Gray | hsl(0, 0%, 50%) | #808080 |
| Orange | hsl(39, 100%, 50%) | #FFA500 |
| Purple | hsl(300, 100%, 25%) | #800080 |
| Pink | hsl(350, 100%, 88%) | #FFC0CB |
| Brown | hsl(0, 59%, 41%) | #A52A2A |
| Navy | hsl(240, 100%, 25%) | #000080 |
| Teal | hsl(180, 100%, 25%) | #008080 |
| Coral | hsl(16, 100%, 66%) | #FF7F50 |
HSL is best when you want to adjust a color by eye or in code: raise the lightness for a hover state, lower the saturation for a muted variant. HEX is the most compact way to write a color in CSS and design tools, so it is the code most people copy and share.
More utilities that also run without leaving your browser.