RGB to HSL converter

Paste any RGB color and get its HSL value instantly, together with every other format: HEX, RGB, HSL, HWB, CMYK and OKLCH. Free, and it runs in your browser.

  • Free
  • No sign-up
  • Runs in your browser
rgb-to-hsl

Fill in the values above to see the result.

100% private — the calculation is done in your browser and nothing is sent to any server.

How it works

Enter the color

Type or paste a RGB code, or pick a color with the color picker.

Read the HSL value

Every format updates as you type and shows a live preview of the color.

Copy it

Use the copy button next to the format you need.

How to convert RGB to HSL

To convert RGB to HSL, enter your RGB color in the box above and read the HSL value next to it. For example, rgb(245, 158, 11) is hsl(38, 92%, 50%). The result updates as you type, and every other format (HEX, RGB, HSL, CMYK and more) is shown at the same time.

What RGB and HSL mean

RGB describes a color as amounts of red, green and blue light, each from 0 to 255. rgb(59, 130, 246) is the same color as #3B82F6. CSS also accepts an opacity value, as in rgba(59, 130, 246, 0.5).

HSL describes a color as hue (0 to 360 degrees around the color wheel), saturation (0 to 100 percent) and lightness (0 to 100 percent). It is easier to reason about than RGB: keep the hue and change the lightness to get lighter or darker shades of the same color.

Convert RGB to HSL by hand

Here is the calculation for rgb(245, 158, 11), step by step:

  1. Divide each channel by 255: 0.961, 0.620, 0.043.
  2. Lightness is the average of the largest and smallest values: 50%.
  3. Saturation depends on how far apart they are (92%), and the hue is the position on the color wheel from the dominant channel (38°).
  4. Result: hsl(38, 92%, 50%).

RGB to HSL table of common colors

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%)
Cyanrgb(0, 255, 255)hsl(180, 100%, 50%)
Magentargb(255, 0, 255)hsl(300, 100%, 50%)
Grayrgb(128, 128, 128)hsl(0, 0%, 50%)
Orangergb(255, 165, 0)hsl(39, 100%, 50%)
Purplergb(128, 0, 128)hsl(300, 100%, 25%)
Pinkrgb(255, 192, 203)hsl(350, 100%, 88%)
Brownrgb(165, 42, 42)hsl(0, 59%, 41%)
Navyrgb(0, 0, 128)hsl(240, 100%, 25%)
Tealrgb(0, 128, 128)hsl(180, 100%, 25%)
Coralrgb(255, 127, 80)hsl(16, 100%, 66%)

When to use RGB and when HSL

RGB is the model screens use and the one CSS functions such as rgba() build on, which makes it handy when you need transparency or want to compute colors in code. HSL is best when you want to adjust a color by eye or in code: raise the lightness for a hover state, lower the saturation for a muted variant.

Good to know

  • Shorthand HEX codes such as #38F expand to #3388FF, and eight-digit codes carry an opacity value at the end.
  • Values are rounded to whole numbers for display; the converter keeps more precision internally.
  • The color picker lets you pick a color by eye when you do not have its code.
  • Colors displayed on screen depend on your monitor's calibration, so the same code can look slightly different on different devices.

Frequently asked questions

How do I convert RGB to HSL?
Enter the RGB color in the converter at the top of this page and read the HSL value. For rgb(245, 158, 11) the result is hsl(38, 92%, 50%).
What is RGB?
RGB describes a color as amounts of red, green and blue light, each from 0 to 255. rgb(59, 130, 246) is the same color as #3B82F6. CSS also accepts an opacity value, as in rgba(59, 130, 246, 0.5).
What is HSL?
HSL describes a color as hue (0 to 360 degrees around the color wheel), saturation (0 to 100 percent) and lightness (0 to 100 percent). It is easier to reason about than RGB: keep the hue and change the lightness to get lighter or darker shades of the same color.
Can I convert to other formats at the same time?
Yes. The converter shows HEX, RGB, HSL, HWB, CMYK and OKLCH together, and you can copy any of them.
Is the conversion exact?
The result is mathematically derived from the RGB values and rounded for display. CMYK in particular is an approximation, because printers and inks vary.
Is it free and private?
Yes. It is free, needs no sign-up and works in your browser, so the colors you type are never sent to a server.