Skip to main content
ToolCube – All tools at one place.

HSL to RGB Converter

Enter a color as hue, saturation and lightness to get its red, green and blue values from 0 to 255.

  • HSL to RGB preselected
  • Every format with Copy
  • Contrast checker

Convert a color

Detected: HSL

RGB
HSL

All formats

  • RGBrgb(255, 102, 0)
  • HEX#ff6600
  • HSLhsl(24, 100%, 50%)
  • HSV / HSBhsv(24, 100%, 100%)
  • CMYKcmyk(0%, 60%, 100%, 0%)
  • Nameclosest: orangered
  • CSScolor: #ff6600;

CMYK values are an approximation for screen colors; printed colors depend on the printer profile.

Pick a color from an image

Upload a photo or screenshot (JPG, PNG, WebP, AVIF or iPhone HEIC), then click or tap any point to pick its color. The image stays on your device.

Want to recolor part of an image? Try Change Image Color.

Shades, tints and harmonies

Shades (darker)

  • #e85d00
  • #d15300
  • #b94a00
  • #a24100
  • #8b3800
  • #742e00
  • #5d2500
  • #461c00
  • #2e1300
  • #170900

Tints (lighter)

  • #ff7417
  • #ff822e
  • #ff9046
  • #ff9e5d
  • #ffac74
  • #ffb98b
  • #ffc7a2
  • #ffd5b9
  • #ffe3d1
  • #fff1e8

Harmonies

Complementary – Opposite on the color wheel (180°).

Analogous – Neighbours 30° either side.

Triadic – Three colors 120° apart.

Split-complementary – The two colors next to the complement (150° and 210°).

Tetradic (square) – Four colors 90° apart.

Contrast checker (WCAG)

  • Your color on white

    2.93:1

    Sample of your color as text on #ffffff: contrast 2.93:1.

    • AA normal: Fail
    • AA large: Fail
    • AAA normal: Fail
    • AAA large: Fail
  • Your color on black

    7.15:1

    Sample of your color as text on #000000: contrast 7.15:1.

    • AA normal: Pass
    • AA large: Pass
    • AAA normal: Pass
    • AAA large: Pass
  • Your color on #1e3a8a

    3.52:1

    Sample of your color as text on #1e3a8a: contrast 3.52:1.

    • AA normal: Fail
    • AA large: Pass
    • AAA normal: Fail
    • AAA large: Fail

Guide

How to convert HSL to RGB

  1. Write S and L as fractions (50% = 0.5) and find chroma C = (1 − |2L − 1|) × S.
  2. X = C × (1 − |(H ÷ 60) mod 2 − 1|) and m = L − C ÷ 2.
  3. For hues 0–60° use (C, X, 0); 60–120° (X, C, 0); 120–180° (0, C, X); 180–240° (0, X, C); 240–300° (X, 0, C); 300–360° (C, 0, X).
  4. Add m to each value, multiply by 255 and round: hsl(24, 100%, 50%) gives rgb(255, 102, 0).

Where you need RGB

Canvas drawing, image processing, LED controllers, game engines and many programming libraries work with RGB numbers. If your palette was designed in HSL, converting gives the exact channel values those tools expect.

RGB values are whole numbers, so the result is rounded. Two HSL colors that differ by a tiny amount can give the same RGB values, which simply means the difference is too small to show on a screen.

Transparency

If your color has an alpha value, such as hsla(24, 100%, 50%, 0.25), the converter gives rgba(255, 102, 0, 0.25). The alpha stays exactly the same; only the color part is converted. In the preview, transparency is shown over a checkerboard so you can see how see-through the color is.

Alpha can be written as a number from 0 to 1 or as a percentage. Both hsla(24, 100%, 50%, 0.5) and hsl(24 100% 50% / 50%) mean half transparent.

HSL in code and animations

HSL is handy for generating colors in code: stepping the hue from 0 to 360 gives a rainbow, and keeping saturation and lightness fixed gives a set of colors that look equally strong, such as the lines of a chart. Many drawing and animation libraries still expect RGB, so the last step is converting each generated color.

If you animate between two colors, interpolating in HSL keeps vivid colors bright, while interpolating in RGB can pass through a dull grey in the middle.

HSL to RGB chart of common colors

HSL to RGB values for common colors
ColorHSLRGB
Blackhsl(0, 0%, 0%)rgb(0, 0, 0)
Whitehsl(0, 0%, 100%)rgb(255, 255, 255)
Redhsl(0, 100%, 50%)rgb(255, 0, 0)
Limehsl(120, 100%, 50%)rgb(0, 255, 0)
Bluehsl(240, 100%, 50%)rgb(0, 0, 255)
Yellowhsl(60, 100%, 50%)rgb(255, 255, 0)
Cyanhsl(180, 100%, 50%)rgb(0, 255, 255)
Magentahsl(300, 100%, 50%)rgb(255, 0, 255)
Silverhsl(0, 0%, 75.3%)rgb(192, 192, 192)
Grayhsl(0, 0%, 50.2%)rgb(128, 128, 128)
Maroonhsl(0, 100%, 25.1%)rgb(128, 0, 0)
Olivehsl(60, 100%, 25.1%)rgb(128, 128, 0)
Greenhsl(120, 100%, 25.1%)rgb(0, 128, 0)
Purplehsl(300, 100%, 25.1%)rgb(128, 0, 128)
Tealhsl(180, 100%, 25.1%)rgb(0, 128, 128)
Navyhsl(240, 100%, 25.1%)rgb(0, 0, 128)
Orangehsl(38.8, 100%, 50%)rgb(255, 165, 0)
Tomatohsl(9.1, 100%, 63.9%)rgb(255, 99, 71)

Other colors: use the converter above or the Color Converter.

FAQ

Frequently Asked Questions

Answers to common questions about HSL to RGB on ToolCube.

What is hsl(120, 100%, 25%) in RGB?

It is rgb(0, 128, 0), the CSS color green.

Why do I get the same RGB for slightly different HSL values?

RGB has 256 steps per channel. Very small HSL changes can round to the same values, so the colors look identical.

Is the alpha changed when converting?

No. The alpha value is copied unchanged from hsla to rgba.