Color Tools

HEX to HSL Converter

Convert HEX color codes to HSL (Hue, Saturation, Lightness) and HSLA format with real-time preview, native color picker, channel sliders, and instant copy.

HEX Input & Visual Controls

Valid
Supports 3, 6, and 8-digit HEX
#
Hue (H)
°
Saturation (S)
%
Lightness (L)
%
Alpha / Opacity (A)
%
Clickable Sample Color Palette

Live Color Preview

#006D77
Teal
hsl(185, 100%, 23%)
Hue (H)
185°
Saturation (S)
100%
Lightness (L)
23%
Alpha (A)
1.00
CSS HSL Syntax hsl(185, 100%, 23%)
CSS HSLA Syntax hsla(185, 100%, 23%, 1)
Normalized HEX #006D77
RGB Representation rgb(0, 109, 119)
Complementary Color
Analogous Color Harmony
Tints & Shades (Lightness Variations)

Color Specifications & Mathematical Breakdown

Normalized HEX
#006D77
RGB Channels
R: 0, G: 109, B: 119
HSL Coordinates
185°, 100%, 23%
Alpha Channel
1.00 (100% Opaque)
Relative Luminance (L)
0.1342
Recommended Text Color
#FFFFFF (Light Text)

Comprehensive Guide to HEX to HSL Color Conversion

Understanding the HSL Color Space

HSL stands for Hue, Saturation, and Lightness. Unlike the RGB or HEX color models—which represent colors by mixing physical red, green, and blue light components—the HSL color model aligns closely with how humans perceive and describe color:

  • Hue (0°–360°): The color family or wavelength on the color wheel: 0° is Red, 60° is Yellow, 120° is Green, 180° is Cyan, 240° is Blue, and 300° is Magenta.
  • Saturation (0%–100%): The intensity, purity, or vibrancy of the color. 0% represents a neutral grayscale tone, while 100% represents a vivid, fully saturated pigment.
  • Lightness (0%–100%): The amount of brightness or white/black mixed with the hue. 0% is pitch black, 100% is pure white, and 50% represents the true pigment color.

Why Web Developers Prefer HSL

While HEX codes (such as #006D77) are compact, making color adjustments in pure HEX is difficult without a color picker. With HSL:

  • Easy Hover States: Darken or lighten a button simply by increasing or decreasing the lightness value (e.g. hsl(185, 100%, 23%) → hsl(185, 100%, 30%)).
  • Consistent Color Palettes: Keep hue and saturation constant while modulating lightness to generate balanced UI backgrounds, borders, and text shades.
  • Semantic Themes: Change your entire theme color dynamically by adjusting a single CSS variable for Hue!

Mathematical Conversion Algorithm: HEX to HSL

The conversion from hexadecimal to HSL takes place in three distinct steps:

1. Normalize RGB: r = R / 255, g = G / 255, b = B / 255
2. Identify Extrema: max = max(r, g, b), min = min(r, g, b), delta = max - min
3. Lightness: L = (max + min) / 2
4. Saturation: If delta == 0 → S = 0. Else if L ≤ 0.5 → S = delta / (max + min). Else → S = delta / (2 - max - min)
5. Hue:
   • If delta == 0 → H = 0°
   • If max == r → H = ((g - b) / delta + (g < b ? 6 : 0)) × 60°
   • If max == g → H = ((b - r) / delta + 2) × 60°
   • If max == b → H = ((r - g) / delta + 4) × 60°

Frequently Asked Questions (FAQ)

A HEX to HSL converter is an online design and development utility that transforms hexadecimal color codes (like #FF5733 or #006D77) into their cylindrical-coordinate HSL (Hue, Saturation, Lightness) equivalents. This makes it easier for frontend developers and designers to adjust lightness, saturation, and hue variations in CSS.

A 3-digit HEX code (e.g. #F0A) is shorthand for a 6-digit HEX code where each character is doubled. For example, #F0A expands to #FF00AA. Our converter automatically expands 3-digit shorthand into standard 6-digit notation before performing the mathematical HSL conversion.

Yes! The tool fully supports 8-digit hexadecimal values (#RRGGBBAA). The first six characters are converted into Hue, Saturation, and Lightness, while the final two characters represent the alpha opacity channel (0–255), which is normalized to a 0.00–1.00 float for the CSS hsla() output.

Black (#000000), White (#FFFFFF), and all shades of gray are achromatic colors, meaning the red, green, and blue values are equal ($R = G = B$). Because the difference between the maximum and minimum RGB channels is zero ($Delta = 0$), there is no chromatic pigment or color intensity present, resulting mathematically in $H = 0^circ$ and $S = 0%$.

While both models use Hue and Saturation, HSL uses Lightness, where 0% is black, 50% is the pure hue, and 100% is pure white. HSV (or HSB) uses Value or Brightness, where 100% brightness at 100% saturation represents the pure hue (not white). HSL is the official native standard supported in CSS across all modern web browsers.

In CSS, you can define colors using the hsl() function. For example:
/* Standard legacy CSS */
color: hsl(185, 100%, 23%);
color: hsla(185, 100%, 23%, 0.8);

/* Modern CSS Color Module Level 4 syntax */
color: hsl(185deg 100% 23% / 80%);
Both syntaxes are valid in modern web browsers.

No. The conversion from 24-bit sRGB hexadecimal colors into floating-point HSL coordinates is mathematically exact. Display values round Hue to the nearest integer degree ($0^circ–360^circ$) and Saturation/Lightness to percentages ($0%–100%$), which reproduces the original RGB values accurately in CSS engines.

Yes! All calculations, color harmonies, and preview updates are performed 100% client-side in your web browser. No color codes, palette selections, or personal information are ever transmitted to or stored on our servers.
Copied to clipboard!