RGB to HSL Converter

Convert RGB color values to HSL (hue, saturation, lightness) instantly with the formula shown.

The formula

Scale R, G, B to 0–1. L = (max + min)/2; S = (max − min)/(1 − |2L − 1|); H = 60° × the position of the largest channel relative to the other two.

Common colors

ColorHEXRGBHSLOKLCH
#000000rgb(0, 0, 0)hsl(0 0% 0%)oklch(0% 0 0)
#FFFFFFrgb(255, 255, 255)hsl(0 0% 100%)oklch(100% 0 0)
#FF0000rgb(255, 0, 0)hsl(0 100% 50%)oklch(62.8% 0.258 29.2)
#00FF00rgb(0, 255, 0)hsl(120 100% 50%)oklch(86.6% 0.295 142.5)
#0000FFrgb(0, 0, 255)hsl(240 100% 50%)oklch(45.2% 0.313 264.1)
#FFFF00rgb(255, 255, 0)hsl(60 100% 50%)oklch(96.8% 0.211 109.8)
#00FFFFrgb(0, 255, 255)hsl(180 100% 50%)oklch(90.5% 0.155 194.8)
#FF00FFrgb(255, 0, 255)hsl(300 100% 50%)oklch(70.2% 0.322 328.4)
#808080rgb(128, 128, 128)hsl(0 0% 50%)oklch(60% 0 0)
#FFA500rgb(255, 165, 0)hsl(39 100% 50%)oklch(79.3% 0.171 70.7)
#800080rgb(128, 0, 128)hsl(300 100% 25%)oklch(42.1% 0.193 328.4)
#008080rgb(0, 128, 128)hsl(180 100% 25%)oklch(54.3% 0.093 194.8)

Frequently asked questions

Why convert RGB to HSL?

HSL makes it easy to create lighter, darker or less saturated versions of a color by changing one number.