IT Market
Tools/Design/Colors/HEX to HSL Converter Online for CSS
HEX → HSL

Конвертер цветов из HEX в HSL

Tool guide

HEX to HSL Converter Online for CSS

A HEX code is easy to copy but tells you nothing about how light or saturated a colour is. HSL splits the same colour into three readable numbers: hue in degrees, saturation and lightness in percent. From there a hover state, a disabled button or a dark-theme variant is one number away: move lightness, leave hue alone. Paste a code such as #1E90FF and take the ready-made value; parsing runs in your browser. See also: convert HSL values back to a HEX code, turn HSL into RGB values for CSS, find a readable pair of colours by contrast.

How to use it

  1. Paste a six-digit code into the «HEX colour» field, replacing the default #FF0000.
  2. Press «Convert» and the hue in degrees plus two percentages appear underneath.
  3. Read the first number as a position on the colour wheel: 0 is red, 120 green, 240 blue.
  4. Build interface states by moving only the third number — 40% lightness for pressed, 90% for a card background.
  5. Press «Copy» and paste the value into a CSS custom property or Figma's HSL field.

FAQ

Why is HSL easier to work with than HEX in an interface?

HSL splits a colour along axes that mean something, so you can edit it deliberately. Keep the hue, move the lightness, and the whole scale falls out: hover, active, disabled, card background. With HEX you would be guessing at six characters or reaching for a picker every time.

Why does grey come back with zero saturation and an arbitrary hue?

Achromatic colours have no position on the colour wheel — the red and blue channels are equal, so there is no angle to compute. The formula returns 0°, and with S at 0 that number changes nothing: hsl(0, 0%, 20%) and hsl(200, 0%, 20%) render the same grey.

Are the percentages rounded, and does that shift the colour?

They are rounded to whole numbers, so converting back can land one step off in an RGB channel. That is invisible to the eye, but if you diff screenshots in automated tests keep HEX as the source of truth and use HSL as the working notation while picking shades.

How do I write the result in CSS correctly?

The classic syntax needs commas and percent signs: hsl(210, 100%, 56%). Current browsers also accept the space-separated form with alpha, hsl(210 100% 56% / 0.5). The hue can be a bare number; the deg unit is optional.

Does the field accept the three-character shorthand?

Entering all six characters is safer. Shorthand such as #1AF means #11AAFF and not every parser expands it, so if pressing the button leaves the result unchanged, double each character by hand and try once more.

Is the colour I enter stored on the site's server?

No. Everything happens in the page script: the code is split into channels and recalculated inside the tab. The tool keeps no history, which is why a reload puts the default sample back into the field.

Examples

Link blue prepared for a dark theme
Before: #1E90FF
After: H 210°, S 100%, L 56% — dropping L to 45% is enough for the dark variant
Success green from a design system
Before: #2E7D32
After: H 123°, S 46%, L 34%