RGB to HSL Converter

Convert RGB colour values into hue, saturation and lightness.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Enter red, green and blue values from 0–255 and get the equivalent HSL — hue, saturation, and lightness — instantly, with a live colour swatch you can copy as a CSS hsl() value.

How it works

The converter normalises each RGB channel to the 0–1 range and finds the maximum and minimum of the three. Their average gives lightness. The difference between them (the chroma), divided relative to lightness, gives saturation. The hue is determined by which channel is largest and by how far the other two differ, mapped onto the 0–360° colour wheel. This is the standard RGB-to-HSL conversion; the tool rounds hue to a whole degree and saturation and lightness to whole percents.

Example

Convert rgb(59, 130, 246):

  • Normalised max = 246/255, min = 59/255
  • Lightness ≈ 60%
  • Saturation ≈ 91%
  • Hue ≈ 217°
  • Result: hsl(217, 91%, 60%)
RGBHSL
rgb(255, 0, 0)hsl(0, 100%, 50%)
rgb(0, 255, 0)hsl(120, 100%, 50%)
rgb(128, 128, 128)hsl(0, 0%, 50%)
rgb(59, 130, 246)hsl(217, 91%, 60%)

The whole conversion runs in your browser — nothing is uploaded.

Ad placeholder (rectangle)