RGB to HSL Converter – Free Colour Tool Online

optimisation du moteur de recherche
  1. Home
  2. Developer Tools
  3. RGB to HSL Converter
Share: Report

RGB to HSL Converter

100% free · Runs 100% in your browser · Live two-way conversion · No signup needed

HSL values (editable)

° (0-360)
% (0-100)
% (0-100)

Try an example: Violet #7C3AED · Teal #0D9488 · Orange #F97316

Move any slider, type in any number field, or edit the HSL values - everything stays in sync and the preview updates live.

Sur RGB to HSL Converter

What Is an RGB to HSL Converter?

An RGB to HSL converter changes a colour from the RGB model used by screens into the HSL model used by designers and CSS code. RGB describes a colour with three numbers for red, green and blue, each from 0 to 255, while HSL uses hue, saturation and lightness, which match how people actually think about colour. A designer who sees rgb(52, 152, 219) may struggle to picture it, but the HSL version, a hue of 204 degrees with 70 percent saturation and 53 percent lightness, immediately says blue, fairly vivid, medium bright. This free converter does the translation instantly and shows a live preview of the colour. Enter your values, or pick a colour, and the HSL values appear right away, ready to copy into your stylesheet.

Understanding RGB: How Screens Make Colour

RGB stands for red, green and blue, the three colours of light that screens combine to produce every colour you see. Each channel runs from 0 to 255, where 0 means none of that light and 255 means the maximum. Pure red is rgb(255, 0, 0), pure green is rgb(0, 255, 0), pure blue is rgb(0, 0, 255), and equal amounts of all three make shades of grey, from black at rgb(0, 0, 0) to white at rgb(255, 255, 255). Mixing them creates millions of colours: red and green make yellow, red and blue make magenta, green and blue make cyan. RGB is the native language of monitors, phones, cameras and image files, which is why design tools report colours this way. It is precise but not intuitive, which is why designers often convert to HSL.

Understanding HSL: Hue, Saturation and Lightness

HSL describes colour in three values that match human perception. Hue is an angle on the colour wheel from 0 to 360 degrees: 0 is red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue and 300 is magenta. Saturation is a percentage from 0 to 100 that measures vividness: 0 percent is a pure grey, while 100 percent is the most intense version of that hue. Lightness is also a percentage: 0 percent is black, 50 percent is the pure hue at full strength, and 100 percent is white. It lets you adjust one quality at a time: lower the saturation for a softer blue, lower the lightness for a darker hover state, or shift the hue for a matching accent. CSS supports HSL directly, so hsl(204, 70%, 53%) works in any modern browser.

How to Use the RGB to HSL Converter

Type your red, green and blue values into the three boxes, each between 0 and 255, or use the sliders and watch the colour change live. You can also click the colour picker to choose a colour visually, or paste a hex code and let the tool read the RGB values from it. As soon as the values change, the HSL result updates automatically, together with a preview swatch showing the colour. The result gives hue in degrees and saturation and lightness as percentages, with a copy button for the full hsl() value. The tool works in your browser on desktop and mobile, with nothing to install and no account to create.

  • Enter your red, green and blue values, from 0 to 255 each.
  • Or pick a colour visually with the colour picker.
  • Read the hue, saturation and lightness values instantly.
  • Check the live preview swatch to confirm the colour.
  • Copy the hsl() value straight into your CSS or design file.

How RGB to HSL Conversion Works

The conversion follows a standard formula. First, each RGB channel is divided by 255 so the values fall between 0 and 1. The largest is called max and the smallest min. Lightness is the average of max and min, multiplied by 100 to give a percentage. If max and min are equal, the colour is a shade of grey, so saturation is 0 and hue is 0. Otherwise, saturation depends on the lightness: for lighter colours it is the difference between max and min divided by their sum, and for darker colours the difference divided by two minus max minus min. Hue depends on which channel is largest: if red is largest it is based on green minus blue, if green is largest on blue minus red plus two, and if blue is largest on red minus green plus four, with the result multiplied by 60 to give degrees. You never need to do this maths yourself.

Why Designers Prefer HSL Over RGB

Designers love HSL because it matches how people think about colour. A brand palette is usually a hue with variations: a main blue, a lighter blue for backgrounds and a darker blue for text. In RGB those three colours look like unrelated numbers, but in HSL they share the same hue and differ only in lightness, which makes the palette easy to maintain. Colour schemes are simple too: complementary colours sit 180 degrees apart, analogous colours sit near each other, and triadic schemes use hues 120 degrees apart. Accessibility work benefits too, since lightness most affects contrast against a background, so you can judge readability just by looking at the lightness number.

RGB to HSL in CSS and Web Design

Modern CSS accepts HSL colours directly, and many developers use HSL because stylesheets become easier to read and adjust. A typical pattern is to define a base hue once as a CSS variable, then create lighter and darker versions by changing only the lightness. For example, a button might use hsl(204, 70%, 53%) normally and hsl(204, 70%, 43%) on hover, a change of one number that is easy to review. This keeps colour systems consistent across a whole site, since every shade derives from the same hue. Switching a site from light mode to dark mode often means changing lightness values while keeping hues fixed. Copy the hsl() value into your CSS and test it in the browser.

Common Colours in RGB and HSL

Some colours are worth knowing by heart. Pure red, rgb(255, 0, 0), is hsl(0, 100%, 50%). Pure green is hsl(120, 100%, 50%) and pure blue is hsl(240, 100%, 50%). Yellow sits at hsl(60, 100%, 50%), cyan at hsl(180, 100%, 50%) and magenta at hsl(300, 100%, 50%). Black has 0 percent lightness, white has 100 percent lightness, and any grey has 0 percent saturation with lightness matching its brightness. A popular sky blue, rgb(52, 152, 219), converts to roughly hsl(204, 70%, 53%). Hue is the colour family, saturation is how strong it is, and lightness is how bright. Try your own colours in the converter to build the same intuition.

Tips for Choosing Better Colours With HSL

Start with the hue that fits the mood of your design: warm hues such as red, orange and yellow feel energetic, while cool hues such as blue and green feel calm and professional. Keep saturation moderate for large areas such as backgrounds, since fully saturated colours can be tiring in big blocks, and save high saturation for small accents such as buttons and links. Use lightness to build hierarchy: headings in a darker shade of your main hue, body text in a dark neutral, and backgrounds in a very light tint of the same hue. Check contrast between text and background, aiming for a large lightness gap so words stay readable. Limit your palette to one or two hues plus neutrals. For more colour work, try the RGB to HEX converter for hex codes, the HEX to RGB converter for the reverse direction, or the colour palette generator to build a full scheme around a colour you like.

If you are building a website, a blog or an online project around your design work, FistHost shared hosting starts at just $0.99/month and includes a free domain with the annual plan, so you can put your projects online for less than the cost of a coffee. Fast servers, free SSL and friendly support make it a simple home for hobby sites and growing businesses alike.

Frequently Asked Questions

Can HSL represent every RGB colour? Yes, the conversion is exact in both directions. Why is my grey showing 0 percent saturation? Greys have no hue, so saturation is zero and lightness alone describes the shade. What does the hue number mean? It is an angle on the colour wheel from 0 to 360 degrees, where 0 is red, 120 is green and 240 is blue. Is HSL supported in all browsers? Yes, hsl() colours work in every modern browser. Can I convert HSL back to RGB? Yes, using the same formula in reverse.

When your project grows beyond a hobby page, FistHost makes it easy to upgrade to a bigger hosting plan without moving your files or changing your domain. With affordable shared hosting from $0.99/month and a free domain on annual plans, you can start small today and scale up whenever your audience grows.

User Reviews

No reviews yet. Be the first to review this tool!

Write a Review

★★★★★

Captcha

Reviews are protected by captcha and moderated before they appear.


FistHost

Blazing-Fast Web Hosting

Plans from $0.99/mo
Free domain included

Get Hosting
Limited Offer Hosting From $0.99/mo Use code welcomegift · for extra savings today Claim Offer