Skip to content
⚠ TESTING ENVIRONMENT You are viewing a testing copy of Tolioo. Changes here do not affect the live website.

HSL to RGB Converter

Convert HSL to RGB, HEX and HSV instantly, with alpha, colour harmonies and a batch mode. Free and private.

  • 100% free
  • No Signup
  • Two-way conversion
  • Runs in your browser

HSL colour

°
%
%
Quick colours

Colour harmonies and shades

Built from your current colour by rotating the hue or changing the lightness. Click any swatch to load it into the converter.

Tints & shades

Batch HSL to RGB converter

Paste many colours at once, one per line. Accepts hsl(204, 70%, 53%), 204 70 53 or 204, 70%, 53%.

Results
ColourHSL inputRGBHEX
Results will appear here.
ADVERTISEMENT
Demo Ad 728 x 90

How to convert HSL to RGB

1Enter HSL values

Type hue, saturation and lightness, or drag the colourful sliders.

2Read the RGB result

Red, green and blue update live, together with HEX, HSV and alpha formats.

3Copy and use

Copy CSS, Swift, Android or Flutter code, or convert a full list to CSV.

COLOUR CONVERSION GUIDE

HSL to RGB Converter – Convert HSL, HEX and CSS Colours Online

Need to turn an HSL colour into RGB or HEX in a hurry? This free HSL to RGB converter does it the moment you type. Enter the hue, saturation and lightness of a colour, or drag the live gradient sliders, and the matching red, green and blue values appear instantly, together with the HEX code, the HSV (HSB) values and ready-to-paste code for CSS, Swift, Android and Flutter. It is built for web developers, UI designers, front-end engineers, students and anyone who works with colour codes. You can also use it as an RGB to HSL converter, because every field works in both directions, and you can add an alpha (opacity) value to get rgba, hsla and 8-digit HEX colours. Below the converter you will find colour harmony and shade generators that build complementary, analogous, triadic and tetradic palettes from your colour, and a batch tool that converts a whole list of HSL values into RGB and HEX and exports them as CSV. Everything runs inside your browser, with no signup, no watermark and no upload, so your colours stay private.

HSL to RGB Converter

Convert HSL to RGB online with accurate rounding and live preview. Set the hue angle from 0 to 360 degrees, then adjust saturation and lightness from 0 to 100 percent and read the red, green and blue channel values from 0 to 255. Each channel has its own bar, so you can see how the colour is built.

HSL to HEX Converter

Need a HEX code for your stylesheet, design tool or brand guide? The converter shows the 6-digit HEX code of every HSL colour and an 8-digit version that includes alpha. Type a HEX code to get HSL back, and copy any format with a single click.

Palette and Batch Tools

Create harmonious palettes from one colour with complementary, analogous, triadic, split-complementary and tetradic schemes, build a tint and shade scale, or paste a long list of HSL values and convert them all at once. Download the table as a CSV file for your project or design system.

How to Convert HSL to RGB Online (Step by Step)

You do not need a design app or a calculator to turn HSL into RGB. Follow these simple steps with our free colour converter.

  1. Enter the hue: Type a number from 0 to 360 or drag the rainbow slider. 0 is red, 120 is green and 240 is blue.
  2. Set the saturation: Choose how vivid the colour is, from 0 percent (grey) to 100 percent (full colour).
  3. Set the lightness: Choose how light or dark the colour is, from 0 percent (black) through 50 percent (pure colour) to 100 percent (white).
  4. Add transparency if you need it: Use the alpha slider from 0 (fully transparent) to 1 (fully opaque) to get rgba, hsla and 8-digit HEX values.
  5. Read the RGB values: The red, green and blue numbers update live, along with the HEX code, HSV values and developer snippets.
  6. Copy the format you need: Press Copy next to CSS, HEX, Swift, Android or Flutter output and paste it into your project.

To go from RGB or HEX to HSL, type into the RGB boxes or the HEX field, and the HSL fields and sliders update automatically. For many colours at once, use the batch converter.

What Is HSL? Hue, Saturation and Lightness Explained

HSL describes a colour in the way people naturally think about it. Instead of mixing red, green and blue light, you choose a colour on the colour wheel, decide how intense it is and then decide how light or dark it should be. That is why many designers find HSL easier to read and edit than RGB or HEX. If you want a slightly darker version of a button colour, you reduce the lightness by a few percent, and nothing else needs to change.

  • Hue (H): The position on the colour wheel in degrees, from 0 to 360. Red starts at 0, green sits at 120, blue at 240, and the wheel returns to red at 360.
  • Saturation (S): The intensity of the colour in percent. 100 percent is a rich, vivid colour, and 0 percent is a neutral grey.
  • Lightness (L): How much white or black is mixed in. 0 percent is black, 100 percent is white, and 50 percent shows the colour at its most pure.

The table below lists the main hue angles and the colours they produce at 100 percent saturation and 50 percent lightness.

Hue angles and their colours
Hue (degrees) Colour HSL RGB
0° / 360°Redhsl(0, 100%, 50%)255, 0, 0
30°Orangehsl(30, 100%, 50%)255, 128, 0
60°Yellowhsl(60, 100%, 50%)255, 255, 0
120°Green (lime)hsl(120, 100%, 50%)0, 255, 0
180°Cyanhsl(180, 100%, 50%)0, 255, 255
240°Bluehsl(240, 100%, 50%)0, 0, 255
270°Violethsl(270, 100%, 50%)128, 0, 255
300°Magentahsl(300, 100%, 50%)255, 0, 255
330°Rosehsl(330, 100%, 50%)255, 0, 128

HSL vs RGB vs HEX: Which Colour Format Should You Use?

All three formats can describe the same colours on a screen, but they are written differently and suit different jobs. RGB and HEX describe how much red, green and blue light a pixel emits. HSL describes the colour in terms of hue, saturation and lightness, which is closer to how people think about colour. The table below compares them.

HSL vs RGB vs HEX
Feature HSL RGB HEX
Example hsl(204, 70%, 53%) rgb(52, 152, 219) #3498DB
What it describes Hue, saturation, lightness Red, green, blue amounts The same RGB amounts in base 16
Easy to read and adjust Very easy Moderate Hard to guess by eye
Best for Design systems, themes, hover states, palettes Image processing, canvas, animation Brand guides, design handoff, short code
Transparency hsla() or the alpha slash rgba() or the alpha slash 8-digit HEX such as #3498DBCC
Supported in CSS Yes Yes Yes

A practical approach is to design with HSL, because it is easy to adjust, and to convert to HEX or RGB when a tool, library or platform asks for it. This converter keeps all three formats in sync, so you never have to calculate by hand.

HSL to RGB Formula Explained With Examples

The conversion from HSL to RGB follows a precise formula. Knowing it helps you check results and write your own converter in any programming language.

  1. Normalise: Convert saturation and lightness from percent to fractions, so S and L are between 0 and 1.
  2. Calculate chroma: C = (1 − |2L − 1|) × S. Chroma is the strength of the colour.
  3. Calculate X: X = C × (1 − |(H ÷ 60) mod 2 − 1|). This is the second largest component.
  4. Calculate the offset: m = L − C ÷ 2. This lifts every channel to the right lightness.
  5. Choose the sector: Depending on the hue range (0–60, 60–120, 120–180, 180–240, 240–300, 300–360), the pair (R′, G′, B′) is (C, X, 0), (X, C, 0), (0, C, X), (0, X, C), (X, 0, C) or (C, 0, X).
  6. Finish: R = (R′ + m) × 255, G = (G′ + m) × 255 and B = (B′ + m) × 255, rounded to whole numbers.

Example 1: HSL(204, 70%, 53%). S = 0.7 and L = 0.53, so C = (1 − |1.06 − 1|) × 0.7 = 0.658. H ÷ 60 = 3.4, so X = 0.658 × (1 − |1.4 − 1|) = 0.395. Then m = 0.53 − 0.329 = 0.201. The hue is in the 180–240 sector, so (R′, G′, B′) = (0, X, C). Therefore R = 0.201 × 255 ≈ 51, G = 0.596 × 255 ≈ 152 and B = 0.859 × 255 ≈ 219. The result is RGB(51, 152, 219), which is HEX #3398DB.

Example 2: HSL(0, 100%, 50%). C = (1 − |1 − 1|) × 1 = 1, X = 1 × (1 − |0 − 1|) = 0 and m = 0. The hue is in the first sector, so (R′, G′, B′) = (C, X, 0) = (1, 0, 0). The result is RGB(255, 0, 0), pure red.

The table below lists common colours in HSL with their RGB and HEX values for quick reference.

Common colours: HSL to RGB and HEX
Colour HSL RGB HEX
Black0, 0%, 0%0, 0, 0#000000
White0, 0%, 100%255, 255, 255#FFFFFF
Grey0, 0%, 50%128, 128, 128#808080
Red0, 100%, 50%255, 0, 0#FF0000
Yellow60, 100%, 50%255, 255, 0#FFFF00
Lime120, 100%, 50%0, 255, 0#00FF00
Cyan180, 100%, 50%0, 255, 255#00FFFF
Blue240, 100%, 50%0, 0, 255#0000FF
Magenta300, 100%, 50%255, 0, 255#FF00FF
Maroon0, 100%, 25%128, 0, 0#800000
Olive60, 100%, 25%128, 128, 0#808000
Teal180, 100%, 25%0, 128, 128#008080
Navy240, 100%, 25%0, 0, 128#000080

Using HSL Colours in CSS: hsl(), hsla() and Design Systems

CSS has supported hsl() and hsla() for many years, and every modern browser understands them. You can write the classic comma form, hsl(204, 70%, 53%), or the newer space-separated form with an optional alpha after a slash, hsl(204 70% 53% / 0.8). Because the three parts are independent, HSL is especially good for building consistent interfaces and themes.

A common pattern is to store the hue, saturation and lightness in CSS custom properties and build every state of a component from them:

:root {
  --brand-h: 204;
  --brand-s: 70%;
}
.button        { background: hsl(var(--brand-h) var(--brand-s) 53%); }
.button:hover  { background: hsl(var(--brand-h) var(--brand-s) 46%); }
.button:active { background: hsl(var(--brand-h) var(--brand-s) 40%); }
.button.soft   { background: hsl(var(--brand-h) var(--brand-s) 94%); }

With this approach, changing the whole theme from blue to green only needs one new hue value. Dark mode is also easier, because you can adjust only the lightness. When a library, an image processor, a canvas script or an API needs RGB or HEX instead, convert your HSL values with this tool.

  • Hover and focus states: Lower the lightness by 5 to 8 percent for a darker hover colour.
  • Disabled and muted colours: Reduce the saturation to get a softer, greyer version of the same hue.
  • Backgrounds and borders: Use very high lightness values (90 to 97 percent) for soft tinted backgrounds.
  • Transparency: Add an alpha value for overlays, shadows and glass effects.

Colour Harmonies: Complementary, Analogous, Triadic and More

HSL makes classic colour harmonies easy, because every scheme is just a set of hue rotations on the colour wheel. Keep saturation and lightness the same, change the hue, and you get colours that work well together. The converter builds these palettes for you under the main tool, and you can click any swatch to load it. The table below explains each scheme.

Colour harmony schemes in HSL
Scheme Hue rotation Look and feel
Complementary+180°High contrast, bold and energetic
Analogous−30° and +30°Calm, natural and harmonious
Triadic+120° and +240°Colourful and balanced
Split-complementary+150° and +210°Contrast with less tension than complementary
Tetradic (square)+90°, +180° and +270°Rich and varied, works best with one dominant colour

Tints are made by adding white (higher lightness), shades by adding black (lower lightness) and tones by lowering the saturation. A good user interface palette usually combines one main hue with a range of tints and shades, plus one accent colour taken from a harmony.

HSL vs HSV (HSB) vs HWB: What Is the Difference?

HSL is part of a family of colour models that all use a hue angle. They differ in how they describe brightness, which is why the same colour has different numbers in each model. Colour pickers in many design apps use HSB, while CSS uses HSL and HWB.

HSL, HSV and HWB compared
Model Channels Pure colour is at Common use
HSLHue, saturation, lightnessLightness 50%, saturation 100%CSS, themes, design systems
HSV / HSBHue, saturation, value (brightness)Value 100%, saturation 100%Colour pickers in Photoshop, Figma and similar apps
HWBHue, whiteness, blacknessWhiteness 0%, blackness 0%CSS Color Level 4, intuitive mixing

The tool shows the HSV (HSB) values next to HSL, so you can move a colour from a CSS file to a design app that uses a brightness slider without manual maths.

Does HSL Lightness Equal Perceived Brightness? Contrast and Accessibility

An important detail for accessible design is that HSL lightness is a mathematical value and not the brightness that people actually see. Pure yellow at 50 percent lightness looks much brighter than pure blue at the same 50 percent, because the human eye is more sensitive to green and yellow light than to blue. This means that two colours with the same lightness number can have very different contrast against a white or black background.

For text, buttons and icons, check the contrast ratio instead of relying on lightness. The Web Content Accessibility Guidelines (WCAG) ask for a contrast ratio of at least 4.5 to 1 for normal text and 3 to 1 for large text. HSL is still a great way to explore and organise colour, but always verify contrast with a contrast checker after you have chosen your final shades.

  • Test every text and background pair: Do not assume that lightness 40 percent will always be readable on a light background.
  • Do not rely on colour alone: Add icons, labels or patterns so that colour-blind users get the same information.
  • Check both light and dark themes: A colour that works on white can fail on a dark background.

Common Uses of an HSL to RGB Converter

Colour conversion is a daily task for people in many fields. Here are some of the most popular ways to use an HSL to RGB and HEX converter.

  • Web development: Convert HSL values from a stylesheet into RGB or HEX for JavaScript, canvas, SVG or charts.
  • Design systems and tokens: Generate consistent colour scales and document their HEX and RGB equivalents.
  • Mobile apps: Get ready-to-paste Swift, Kotlin and Flutter colour code for iOS and Android projects.
  • UI and UX design: Prepare hover, active and disabled states and check them in different formats.
  • Data visualisation: Create evenly spaced hues for charts, maps and legends.
  • Game development and graphics: Convert colours for shaders, sprites and engines that need RGB.
  • Branding and marketing: Keep the same brand colour across web, social media and presentation tools.
  • Teaching and learning: Understand how colour models relate with a live, visual calculator.
  • Email and CMS work: Many email clients and editors only accept HEX or RGB, so convert before you paste.

Tips for Working With HSL, RGB and HEX Colours

  • Keep the hue, change the lightness: This is the fastest way to create a family of colours that clearly belong together.
  • Limit saturation for large areas: Very high saturation looks tiring on big backgrounds, so use softer values there.
  • Use whole numbers in handoff: Share HEX codes with developers, and keep the HSL values in your design tokens.
  • Remember that 360 equals 0: Both are the same red, so a hue of 360 wraps around to 0.
  • Check greys separately: At 0 percent saturation the hue does not matter, so every hue gives the same grey.
  • Test on real screens: Phones, laptops and monitors show colours slightly differently.
  • Add alpha last: Choose the solid colour first, then add transparency for overlays and shadows.

Troubleshooting: Why Does My Converted Colour Look Different?

  • The RGB values are off by one: Different tools round differently, and a difference of one step is invisible.
  • The HEX code is not accepted: Use 3, 4, 6 or 8 hexadecimal characters (0–9 and A–F), with or without the # symbol.
  • The hue jumped to 0 for a grey: A grey has no real hue. This tool keeps the previous hue so your sliders do not jump.
  • The batch tool says invalid colour: Make sure each line has three numbers, with hue from 0 to 360 and saturation and lightness from 0 to 100.
  • The colour looks different in another app: Some programs apply a colour profile, so the same RGB values can look slightly different from the browser.

Convert HSL to RGB on Mobile, Windows and Mac

This online HSL to RGB converter works in any modern browser, including Chrome, Safari, Firefox and Edge, on Android, iPhone, iPad, Windows, macOS and Linux. There is nothing to install and no account to create. On a phone, use the sliders with your thumb or the number pad for exact values. On a computer, paste a list of HSL colours from your code editor into the batch converter and copy the result back as CSV. All calculations run inside your browser, so results are instant and your colour data never leaves your device.

Free HSL to RGB Colour Converter: Fast, Accurate and Private

We built this HSL to RGB converter to be the quickest and clearest way to move between colour formats. It is free, needs no signup, converts in both directions, supports alpha, shows HEX, HSV and developer formats, builds harmonies and shades, and includes a batch mode for entire palettes. Your colours never leave your browser.

Ready to try it? Scroll back up, set your hue, saturation and lightness and copy the RGB values for your next project. If you need other colour tools, explore the rest of the free tools on our site.

ADVERTISEMENT
Demo Ad In-article
COMMON QUESTIONS

HSL to RGB Converter FAQ

Quick answers about converting HSL to RGB and HEX, the formula, rounding, CSS usage and how the tool works.

How do I convert HSL to RGB online?

Enter the hue (0 to 360 degrees), saturation (0 to 100 percent) and lightness (0 to 100 percent) in the HSL fields, or move the sliders. The red, green and blue values (0 to 255), the HEX code and other formats update instantly and can be copied with one click. You can also type RGB or HEX values to convert in the opposite direction. The tool is free, needs no signup and runs entirely in your browser.

What is the formula to convert HSL to RGB?

Convert saturation and lightness to fractions between 0 and 1. Calculate chroma C = (1 - |2L - 1|) x S, then X = C x (1 - |(H / 60) mod 2 - 1|) and m = L - C / 2. Depending on which 60 degree sector the hue is in, the pair (R1, G1, B1) is one of (C, X, 0), (X, C, 0), (0, C, X), (0, X, C), (X, 0, C) or (C, 0, X). Finally multiply each of R1 + m, G1 + m and B1 + m by 255 and round to the nearest whole number.

What is the difference between HSL and HSV (HSB)?

Both models describe a colour with a hue angle, but they treat brightness differently. In HSL, lightness 50 percent gives the purest colour, 0 percent is always black and 100 percent is always white. In HSV or HSB, the value or brightness channel at 100 percent gives the brightest version of the colour, and white needs low saturation. HSL is the model used by CSS, while HSV is common in colour pickers inside design software.

Why do my RGB values differ by one from another converter?

RGB channels are whole numbers from 0 to 255, so every converter has to round the calculated value, and some round down, some round to the nearest number and some use slightly different rounding steps. A difference of one in a single channel is invisible to the eye. Rounding HSL values to whole numbers before converting can also shift the result by a small amount, because 1 percent of lightness equals roughly 2.55 steps in RGB.

Can I use HSL colours directly in CSS?

Yes. All modern browsers support hsl() and hsla(), written as hsl(204, 70%, 53%) or in the newer space-separated form hsl(204 70% 53% / 0.8). HSL is popular for design systems because you can keep the hue fixed and change only the lightness to create hover, active and dark mode variants. HEX colours with an alpha channel, such as #3498DBCC, are also supported, and this tool creates them for you.

What happens to the hue when saturation is 0 or lightness is 0 or 100?

When saturation is 0 percent the colour is a shade of grey, so the hue has no visible effect. When lightness is 0 percent the colour is always black, and when it is 100 percent the colour is always white, whatever the hue and saturation are. When you convert such a colour from RGB back to HSL, the hue is undefined, so the tool keeps the last hue you used instead of resetting it to 0.

Are my colours uploaded anywhere, and does the tool work offline?

No. All calculations run inside your own browser with JavaScript, so the colour values you type, pick or paste are not sent to our server and no external service is used. After the page has loaded, the converter keeps working even if your internet connection drops.

ADVERTISEMENT
Demo Ad 970 x 250

All Tools, One Place

Merge, split, compress and convert files in seconds. Explore powerful free tools for all your everyday needs.

Explore All Tools →