Skip to content
hexcolorcodepicker.com

RGB to HSL Converter

HSL

hsl(217, 91%, 60%)

HEX: #3B82F6

  • Hue

    217°

  • Saturation

    91%

  • Lightness

    60%

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

217°
  • Saturation91%
  • Lightness60%

hsl(217, 91%, 60%)

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 59
  • Green 130
  • Blue 246
  1. 1. Lightness — 60% from the largest and smallest channels.
  2. 2. Chroma — 0.733, the gap between largest and smallest.
  3. 3. Saturation — 91% from chroma and lightness.
  4. 4. Hue — 217°, from which channel is largest.

Result: hsl(217, 91%, 60%)

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 wheel217°

0° red · 60° yellow · 120° green · 180° cyan · 240° blue · 300° magenta

Saturation: gray → vivid91%

Lightness: black → white60%

Your color sits at hue 217° — 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%)

Lightness 60%Saturation 100%Hue 11°

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 60% — raise it to lighten, lower it to darken.

Saturation 91% — lower it to mute the color.

Hue 217° — 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 #3B82F6
  • RGB rgb(59, 130, 246)
  • HSL hsl(217, 91%, 60%)

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

RedGreenBlue
Your RGB59130246
After HSL round trip60131246

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.

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.