How to use HSL to RGB converter
- Type the color as hsl(120, 100%, 50%) or simply 120 100 50.
- Read the rgb() value and the swatch, which update as you type.
- Copy the RGB value or any other format from the list.
Features
- Accepts hsl(), hsla() and three plain numbers
- Returns red, green and blue as whole numbers from 0 to 255
- Keeps transparency and returns rgba() when alpha is below 1
- Lists HEX and CMYK as well, with copy buttons
- Runs in your browser with no upload
Examples
| Input | Result |
|---|---|
| hsl(120, 100%, 50%) | rgb(0, 255, 0) |
| hsl(0, 0%, 50%) | rgb(128, 128, 128) |
| hsl(249, 80%, 55%) | rgb(76, 48, 232) |
Limitations
- Channels are rounded to whole numbers, so two slightly different HSL inputs can give the same RGB value. Saturation and lightness must be from 0 to 100, and hue wraps around 360 degrees.
Learn more
Converting HSL to RGB answers a practical question: what red, green and blue values does a browser or an app actually use when a stylesheet says hsl(249, 80%, 55%)? Some APIs, canvas libraries, game engines and image tools only understand RGB, so you need the numbers.
The method is the one defined for CSS. The range of a color's brightness is limited by its lightness, so chroma equals saturation times the smaller of lightness and one minus lightness, twice over. The hue angle is split into six sectors of 60 degrees; in each sector one channel is at its maximum, one at its minimum and one in between. After adding the offset and scaling, you get three numbers from 0 to 255. Rounding to whole numbers is what makes some neighboring HSL values share one RGB result.
Frequently asked questions
How do I convert HSL to RGB?
Compute chroma from saturation and lightness, use the hue to decide how it is spread over red, green and blue, then add the lightness offset and scale to 0 to 255. The tool does it as you type.
Why is hsl(0, 0%, 50%) equal to rgb(128, 128, 128)?
With no saturation all channels are equal, and half lightness is half of 255, which is 127.5 and rounds to 128.
Can I use decimals in HSL?
Yes. Values such as hsl(249.5, 79.8%, 55.2%) are accepted and the result is rounded to whole RGB channels.
Is the result the same as in CSS?
Yes. The formula follows the CSS Color specification, so a browser would paint the same color for hsl() and for the rgb() shown here.
Sources
Last reviewed: September 30, 2026