HSL to HEX Converter — Convert HSL Colors to Hex Codes

Enter Hue (0-360), Saturation (0-100%), and Lightness (0-100%) values to get the corresponding HEX color code. All formats update in real-time.

Why HSL Is More Intuitive

HSL maps directly to how humans think about color. Hue is the color itself — red at 0°, yellow at 60°, green at 120°, cyan at 180°, blue at 240°, magenta at 300°. Saturation controls vividness (0% is gray, 100% is pure color). Lightness controls brightness (0% is black, 50% is pure color, 100% is white).

HSL in CSS

Modern CSS fully supports HSL: color: hsl(217, 92%, 60%) is equivalent to color: #3B82F6. HSL is especially useful with CSS custom properties for creating theme variants: change just the lightness to get hover states, borders, and backgrounds from a single hue.

Creating Color Variations with HSL

Starting from hsl(217, 92%, 60%) (blue), reduce lightness to 40% for a darker variant, increase to 80% for a lighter tint, or reduce saturation to 30% for a muted version. This is much harder with HEX or RGB, where all three values must change simultaneously to shift lightness.

Enter HSL values below to convert to HEX.

Royal Blue
#3B82F5
Presets
HEX
RGB
rgb(59, 130, 245)
HSL
hsl(217, 90%, 60%)
HSV / HSB
CMYK (approx)
RGBA
rgba(59, 130, 245,
)
CSS Variable
--color: #3B82F5;

Frequently Asked Questions

How do I convert HEX to RGB?
Paste or type your HEX code (like #3B82F6) into the HEX field and the RGB values appear instantly — R: 59, G: 130, B: 246. The first two hex characters are red, the middle two are green, the last two are blue.
What is a WCAG contrast ratio and why does it matter?
The WCAG contrast ratio measures how distinguishable two colors are, from 1:1 (no contrast) to 21:1 (maximum). WCAG 2.1 requires a minimum of 4.5:1 for normal text (AA) and 7:1 for the highest standard (AAA). This ensures people with visual impairments can read your content.
What’s the difference between RGB and HSL?
RGB defines colors by mixing red, green, and blue light (0-255 each). HSL describes colors as Hue (color wheel position 0-360°), Saturation (vividness 0-100%), and Lightness (brightness 0-100%). HSL is more intuitive for creating color variations.
Is CMYK conversion accurate?
Our CMYK conversion is mathematically correct but approximate. Precise CMYK values for print depend on ICC color profiles. Our conversion uses the standard formula, sufficient for digital mockups. For production print, use your print provider’s color profile.
Can I extract colors from an image?
Yes. Upload any image and click anywhere on it to pick a pixel’s color, or let the tool extract the 5-6 most dominant colors automatically. The image is processed entirely in your browser — never uploaded to any server.
What color format should I use for web design?
For CSS, HEX (#3B82F6) and RGB are both widely supported. HSL is increasingly preferred because it’s easier to create color variations. For opacity, use RGBA or HSLA. Tailwind CSS uses predefined color classes like bg-blue-500.
How does the palette generator work?
It uses color theory to find harmonious combinations. From your color’s hue on the color wheel, it calculates complementary (180° opposite), analogous (nearby), triadic (120° apart), and other harmonies. These mathematical relationships produce colors that naturally look good together.
Is my data private?
Nothing leaves your browser. All color calculations, conversions, and image processing happen entirely in JavaScript on your device. No data is stored on any server.