HSL To HEX

Convert HSL hue, saturation, and lightness to a six-digit HEX color value.








#FF8000

Reverse Conversion

HEX to HSL

How This Converter Works

Converts hue, saturation, and lightness values to a six-digit uppercase hexadecimal RGB color.

Formula or rule

C=(1-|2L-1|)×S; X=C×(1-|(H/60) mod 2-1|); m=L-C/2; select (R,G,B) from the 60° hue sector, add m, and round each channel×255.

Example

Input
H=30°, S=100%, L=50%
Calculation
C=1; X=1×(1-|0.5-1|)=0.5; m=0; (R,G,B)=(1, 0.5, 0); channels×255=(255, 127.5, 0) rounds to (255, 128, 0).
Result
#FF8000