RGB to HSL converter

Convert any RGB color to HSL, instantly and for free

#9B59B6

Paste any color value. We detect the format for you.

R
G
B
HSL result
Hue
283°
Saturation
39%
Lightness
53%

This color in every format

CMYK profile: Coated FOGRA39 (Photoshop's default for Europe)

RGB tells a screen how much light to emit; HSL tells you what the color actually looks like. Converting the three channels into hue, saturation and lightness makes a color easy to adjust by hand.

How RGB to HSL conversion works

  1. Divide R, G and B by 255 so each value sits between 0 and 1.
  2. Take the maximum and the minimum of the three. Their average is the lightness L.
  3. If maximum and minimum are equal, the color is grey: hue and saturation are both 0.
  4. Otherwise derive S from the spread between maximum and minimum, and read H from whichever channel is the maximum.

Worked example

RGB rgb(155, 89, 182)=HSL hsl(283, 39%, 53%)

Exact in principle. Because H, S and L are usually displayed as rounded whole numbers, converting back may shift a channel by a step or two.

RGB and HSL explained

What is RGB?

RGB describes a color as three channels of light (red, green and blue), each from 0 to 255. It mirrors how screens actually work: all three at 255 give white, all at 0 give black. RGB is the right choice whenever you need to calculate with a color, and rgba() adds transparency on top.

Syntax:
rgb(R, G, B)
Range:
0–255 per channel
Best for:
code, canvas, transparency with rgba()

What is HSL?

HSL splits a color into hue (0–360° on the color wheel), saturation (how colorful, 0–100%) and lightness (how bright, 0–100%). Because each part matches the way people describe color, HSL is the easiest format for building tints, shades and consistent palettes, by hand or in code.

Syntax:
hsl(H, S%, L%)
Range:
0–360°, 0–100%, 0–100%
Best for:
palettes, tints and shades, theming

RGB to HSL reference table

The most common CSS colors, converted from RGB to HSL.

ColorRGBHSL
blackrgb(0, 0, 0)hsl(0, 0%, 0%)
whitergb(255, 255, 255)hsl(0, 0%, 100%)
redrgb(255, 0, 0)hsl(0, 100%, 50%)
limergb(0, 255, 0)hsl(120, 100%, 50%)
bluergb(0, 0, 255)hsl(240, 100%, 50%)
yellowrgb(255, 255, 0)hsl(60, 100%, 50%)
orangergb(255, 165, 0)hsl(39, 100%, 50%)
tealrgb(0, 128, 128)hsl(180, 100%, 25%)
purplergb(128, 0, 128)hsl(300, 100%, 25%)
grayrgb(128, 128, 128)hsl(0, 0%, 50%)

Frequently asked questions

Divide R, G and B by 255 so each value sits between 0 and 1. Take the maximum and the minimum of the three. Their average is the lightness L. If maximum and minimum are equal, the color is grey: hue and saturation are both 0. Otherwise derive S from the spread between maximum and minimum, and read H from whichever channel is the maximum.

Exact in principle. Because H, S and L are usually displayed as rounded whole numbers, converting back may shift a channel by a step or two.

HSL splits a color into hue (0–360° on the color wheel), saturation (how colorful, 0–100%) and lightness (how bright, 0–100%). Because each part matches the way people describe color, HSL is the easiest format for building tints, shades and consistent palettes, by hand or in code.

Yes. The swap button next to the input takes you to the HSL to RGB converter, which works exactly the same way. Both directions use the same formula, just applied in reverse.

HSL shines when you need a related color rather than a specific one: rotate H for a complementary accent, drop S for a muted variant, raise L for a hover state.