RGB to HSL Converter
Enter an RGB color to see it in HSL right away. You get the hue, saturation and lightness plus a color preview, all computed live in your browser.
How to convert RGB to HSL
- Paste or type an RGB color, like rgb(59, 130, 246), into the input box.
- Read the HSL value as it updates live, with a preview swatch of the color.
- Copy the hsl() string with one click to use it in your CSS.
Examples
Pure red
rgb(255, 0, 0)
hsl(0, 100%, 50%)
Tailwind blue-500
rgb(59, 130, 246)
hsl(217, 91%, 60%)
Frequently asked questions
What is the difference between RGB and HSL?
RGB describes a color by mixing red, green and blue light, each from 0 to 255. HSL describes the same color by its hue (the color), saturation (how vivid it is) and lightness (how bright it is). Both can represent the same colors; HSL is just a more intuitive way to think about them.
Why is HSL easier to tweak than RGB?
With HSL you can adjust one property at a time. Want a darker shade of the same color? Lower the lightness. Want it less vivid? Lower the saturation. In RGB you would have to change all three channels together to get the same effect, which is much harder to reason about.
What do hue, saturation and lightness mean?
Hue is an angle from 0 to 360 degrees on the color wheel, where 0 is red, 120 is green and 240 is blue. Saturation runs from 0% (gray) to 100% (full color). Lightness runs from 0% (black) through 50% (the pure color) to 100% (white).
Why are the HSL values rounded?
The hue, saturation and lightness are rounded to whole numbers so the output is clean and easy to paste into CSS. For example, rgb(59, 130, 246) becomes hsl(217, 91%, 60%). Rounding can cause a tiny shift, but it is not visible to the eye.
What RGB formats can I paste in?
You can paste a full CSS value like rgb(59, 130, 246) or just the three numbers as 59, 130, 246. Each channel must be between 0 and 255, and values outside that range are flagged as invalid.
Is my color data sent anywhere?
No. The conversion runs entirely in your browser, so the colors you enter never leave your device.
Related tools
HSL to RGB
Convert HSL colors to RGB instantly. Paste hsl(h, s%, l%) or plain h,s,l values and get an rgb() string with a live color swatch. Runs in your browser.
RGB to HEX
Convert RGB to HEX online. Paste rgb(255, 0, 0) or 255,0,0 and get the matching hex color code instantly. Runs in your browser.
Binary to Decimal
Convert binary to decimal online. Paste any binary number, with or without spaces, and get the exact base-10 value instantly. Runs in your browser.
Binary to Hex
Convert binary to hexadecimal online. Paste a binary number and get exact hex, with optional uppercase. Handles huge values. Runs in your browser.
Celsius to Fahrenheit
Convert Celsius to Fahrenheit instantly. Type a temperature in C and get F, with the formula and a quick reference table. Runs in your browser.
Centimeters to Inches
Convert centimeters to inches instantly. Type a length in cm and get inches, with the formula and a quick reference table. Runs in your browser.