RGB to HSL Converter
HSL
hsl(217, 91%, 60%)
HEX:
Hue
Saturation
Lightness
Formula: find the largest and smallest channels. Lightness = (largest + smallest) ÷ 2. Hue and saturation follow from the gap between them.
Convert RGB to HSL free. Enter red, green, and blue values and get hue, saturation, and lightness instantly, with the formula shown and worked examples.
What is the HSL value of this RGB color?
The HSL value of rgb(59, 130, 246) is hsl(217, 91%, 60%). Hue 217° puts it in the blue range, saturation 91% means it is a vivid, strong blue, and lightness 60% means it sits just above the middle between black and white. Those three numbers describe the same color the RGB numbers do, in a form that is easier to adjust.
HSL answers three plain questions about a color: what hue is it, how strong is it, and how light is it? RGB answers a different question — how much red, green, and blue light to mix — which is why designers reach for HSL when they want to change a color.
Hue wheel — your color, live
- Saturation
- Lightness
How to convert RGB to HSL by hand
Convert RGB to HSL by hand in three steps: find the largest and smallest channels, work out lightness from them, then work out hue and saturation. For rgb(59, 130, 246), the largest is blue at 246 and the smallest is red at 59. Lightness is the average of the two as fractions of 255: (0.965 + 0.231) ÷ 2 = 0.598, which rounds to 60%.
Chroma — the gap between largest and smallest — is 0.965 − 0.231 = 0.733. Saturation is chroma divided by (1 − |2 × lightness − 1|), which is 0.733 ÷ 0.804 = 0.912, or 91%. Hue comes from which channel is largest: blue is largest, so hue is 60 × (4 + (red − green) ÷ chroma in whole numbers), which is 60 × (4 + (59 − 130) ÷ 187) = 217°.
Step-by-step — your RGB values, live
- Red
- Green
- Blue
- 1. Lightness — from the largest and smallest channels.
- 2. Chroma — , the gap between largest and smallest.
- 3. Saturation — from chroma and lightness.
- 4. Hue — , from which channel is largest.
Result:
What do hue, saturation, and lightness mean?
Hue is the color itself on a 0–360° wheel, saturation is how strong it is, and lightness is how light or dark it is. Red sits at 0°, yellow at 60°, green at 120°, cyan at 180°, blue at 240°, and magenta at 300°, with red again at 360°. Saturation 0% is gray, and 100% is the most vivid version of that hue.
Lightness 0% is black no matter the hue, 50% is the full color, and 100% is white. That is why lightness 60% in the worked example is a bright blue: it is a little past the full-color point toward white, which softens it slightly without washing it out.
HSL explorer — your color's position
Hue around the wheel
0° red · 60° yellow · 120° green · 180° cyan · 240° blue · 300° magenta
Saturation: gray → vivid
Lightness: black → white
Your color sits at hue — a blue leaning slightly toward cyan.
Worked example: rgb(255, 87, 51) to HSL
rgb(255, 87, 51) converts to hsl(11, 100%, 60%). The largest channel is red at 255 and the smallest is blue at 51. Lightness is (1.000 + 0.200) ÷ 2 = 0.600, or 60%. Chroma is 1.000 − 0.200 = 0.800, and saturation is 0.800 ÷ (1 − |1.200 − 1|) = 0.800 ÷ 0.800 = 1.000, or 100%.
Hue is 60 × (green − blue) ÷ (red − blue) because red is largest: 60 × (87 − 51) ÷ (255 − 51) = 60 × 36 ÷ 204 = 10.6°, which rounds to 11°. The result is a vivid orange-red, fully saturated at a lightness just above the middle.
Second worked example — orange-red
#FF5733
rgb(255, 87, 51)
hsl(11, 100%, 60%)
Hue 11° sits just past red (0°) toward yellow (60°) — an orange-red.
Why use HSL instead of RGB?
Use HSL instead of RGB when you want to adjust a color, because changing one HSL number changes one thing about how the color looks. To make a color lighter, raise lightness; to mute it, lower saturation; to shift it toward green, change hue. Doing the same in RGB means guessing how three numbers interact at once.
That is why design systems are often written in HSL even when they ship as HEX: a whole palette can be built by keeping the hue fixed and stepping lightness up and down. A button hover state, for example, is often the same hue and saturation with lightness raised by 5 to 10 points.
One HSL move vs three RGB moves — your color
Lightness — raise it to lighten, lower it to darken.
Saturation — lower it to mute the color.
Hue — change it to shift the color itself.
Change the RGB values in the tool above and watch these three numbers move — one HSL number, one visible change.
RGB, HSL, and HEX side by side
RGB, HSL, and HEX all describe the same color: RGB says how much light to mix, HSL says what the color looks like, and HEX is RGB written as six hex digits. The color #3B82F6 is rgb(59, 130, 246) and hsl(217, 91%, 60%) at the same time — three notations, one color. HEX is the form developers paste into CSS most often.
Each form has a job: HEX is compact for code, RGB is what screens and canvas code expect, and HSL is what humans adjust. This tool converts between them, and the Color Converter page shows every form at once for the same color.
Three notations, one color — live
- HEX
- RGB
- HSL
Edit any RGB value in the tool above and all three rows update together.
Rounding in HSL — why channels can shift by 1
Rounding in HSL can shift one or two RGB channels by 1 when you convert back, because whole degrees and whole percentages are less precise than the exact values. The exact hue of rgb(59, 130, 246) is 217.2°, which rounds to 217°, and the exact saturation is 91.2%, which rounds to 91%. Converting hsl(217, 91%, 60%) back gives rgb(60, 131, 246): red and green each land 1 higher, while blue stays at 246.
A shift of 1 out of 255 is invisible to the eye — it is less than half a percent of brightness in each shifted channel. It only matters if you need bit-exact round trips, in which case you should keep the HEX code as the source of truth and treat HSL as the editing form.
Round-trip checker — your color, live
| Red | Green | Blue | |
|---|---|---|---|
| Your RGB | 59 | 130 | 246 |
| After HSL round trip | 60 | 131 | 246 |
Any channel that shifted by 1 is shown in the table above — the visible difference is none. Keep the HEX code as the source of truth for exact round trips.
All color tools
21 tools, one topic — see About Hex Color Code Picker for who built this site.
- Color Picker from ImageUpload an image, click a pixel, and read its HEX code.
- Screen EyedropperSample any pixel on your screen.
- RGB to HEX ConverterTurn three RGB numbers into one HEX code.
- HEX to RGB ConverterTurn a HEX code into three RGB numbers.
- HEX to HSL ConverterTurn a HEX code into hue, saturation, and lightness.
- HSL to HEX ConverterTurn HSL values back into a HEX code.
- HEX to HSV ConverterTurn a HEX code into hue, saturation, and value.
- HEX to CMYK ConverterTurn a HEX code into approximate print values.
- RGB to HSL ConverterTurn RGB numbers into hue, saturation, and lightness.
- HEX to OKLCH ConverterTurn a HEX code into the modern OKLCH format.
- Color ConverterSee one color in every format at once.
- HEX to RGBA ConverterTurn a HEX code into RGB with transparency.
- Color Name to HEXLook up any of the 148 CSS named colors.
- Color Palette GeneratorBuild a five-color palette from one color.
- Shades GeneratorBuild 10 tints and 10 shades from one color.
- Gradient GeneratorBuild a linear or radial gradient and copy the CSS.
- Contrast CheckerCheck any text and background pair for AA and AAA.
- Color MixerMix two colors and see the result.
- Random Color GeneratorPick a random color from all 16,777,216 HEX colors.
- Color Blindness SimulatorSee your colors as color-blind users see them.
- Color ChartThe 148 named colors with HEX, RGB, and HSL.
No tool matches your search.
Frequently asked questions
Enter the red, green, and blue values (0–255) and read off hue, saturation, and lightness. For rgb(59, 130, 246) the answer is hsl(217, 91%, 60%). The tool updates live as you type, and the formula is shown step by step on this page.
rgb(255, 87, 51) is hsl(11, 100%, 60%). Hue 11° is an orange-red, saturation 100% means fully vivid, and lightness 60% means just above the middle. It is the same color as HEX #FF5733.
Hue 217° means a blue, on the color wheel between cyan (180°) and blue (240°). Hue is measured in degrees around the wheel: 0° is red, 120° is green, 240° is blue. A hue of 217° is a blue leaning slightly toward cyan.
Because lightness 50% is the full color, not a mid-brightness color — and different hues look brighter or darker at the same lightness. Yellow at 50% lightness looks bright, while blue at 50% looks dark. That is a known weakness of HSL, and OKLCH was designed to fix it.
Yes — the Color Converter page converts in both directions, and every field stays in sync. Type an HSL value there and the RGB and HEX values update at once. HSL alone cannot be pasted into this page, which takes RGB as its input.
HSL and HSV share the same hue but measure the other two parts differently: HSL uses saturation and lightness, HSV uses saturation and value (brightness). The same color has different saturation numbers in the two systems — #3B82F6 is 91% saturated in HSL but 76% in HSV — so do not mix the two up.