Blogs

Tools

Quick Links

Mridul.tech

HSL to RGB Color Converter

Convert HSL to RGB color codes. Enter HSL values and get the corresponding RGB color code.

Preview Color:

Swap

HSL Color Code

RGB Color Code

HSL to RGB color table

ColorNamehslrgb
Black(0,0%,0%)(0,0,0)
White(0,0%,100%)(255,255,255)
Red(0,100%,50%)(255,0,0)
Lime(120,100%,50%)(0,255,0)
Blue(240,100%,50%)(0,0,255)
Yellow(60,100%,50%)(255,255,0)
Cyan(180,100%,50%)(0,255,255)
Magenta(300,100%,50%)(255,0,255)
Silver(0,0%,75%)(192,192,192)
Gray(0,0%,50%)(128,128,128)
Maroon(0,100%,50%)(128,0,0)
Olive(60,100%,50%)(128,128,0)
Green(120,100%,50%)(0,128,0)
Purple(300,100%,50%)(128,0,128)
Teal(180,100%,50%)(0,128,128)
Navy(240,100%,50%)(0,0,128)

What is an HSL Color Code?

The HSL color model describes colors using three key properties:

Hue (H): Represents the type of color on the color wheel (0–360°).

  • 0° = Red
  • 120° = Green
  • 240° = Blue

Saturation (S): Defines the intensity or vividness of the color (0%–100%).

  • 0% = grayscale
  • 100% = full, bright color

Lightness (L): Controls the brightness (0%–100%).

  • 0% = black
  • 50% = normal color
  • 100% = white

Example: hsl(200, 50%, 40%)

What is an RGB Color Code?

The RGB model is based on the primary colors of light: Red, Green, and Blue. Each value ranges from 0 to 255. By mixing these intensities, millions of colors can be created.

  • Format: rgb(R, G, B)
  • Example: rgb(64, 128, 192)

This format is commonly used in CSS, graphic design, photography, and displays.

Why Convert HSL to RGB?

While HSL is great for adjusting colors, many platforms and applications require RGB values.

  • Web Development: CSS and JavaScript frequently use RGB.
  • Graphic Design: Software like Photoshop and Illustrator often work in RGB.
  • Consistency Across Devices: RGB ensures correct rendering on screens.
  • Transparency & Filters: RGB works well with additional features like RGBA (with alpha channel for opacity).

How to Use Our HSL to RGB Color Converter

Our tool makes converting HSL to RGB quick and effortless.

  • Visit the Tool Page: Go to our HSL to RGB Color Converter.
  • Enter HSL Values: Input your Hue, Saturation, and Lightness values (e.g., hsl(200, 50%, 40%)).
  • Get Instant Conversion: The tool immediately returns the RGB equivalent.
    • Example: hsl(200, 50%, 40%) → rgb(51, 102, 153)
  • Copy and Use: Copy the RGB result and apply it in your CSS code, design project, or application.

Examples of HSL to RGB Conversion

  • HSL: hsl(0, 100%, 50%) → RGB: rgb(255, 0, 0) (Red)
  • HSL: hsl(120, 100%, 50%) → RGB: rgb(0, 255, 0) (Green)
  • HSL: hsl(240, 100%, 50%) → RGB: rgb(0, 0, 255) (Blue)
  • HSL: hsl(0, 0%, 0%) → RGB: rgb(0, 0, 0) (Black)
  • HSL: hsl(0, 0%, 100%) → RGB: rgb(255, 255, 255) (White)

Manual Conversion Formula: HSL to RGB

If you want to convert manually, follow these steps:

  • Convert Saturation (S) and Lightness (L) into decimals (0–1).
  • Calculate chroma (C):
    • C = (1 - |2L - 1|) × S
  • Find the X value:
    • X = C × (1 - |(H / 60) % 2 - 1|)
  • Find the match (m):
    • m = L - (C / 2)
  • Depending on Hue, assign RGB temporary values.
  • Convert final RGB values to 0–255 scale.

Example:

  • Input: hsl(200, 50%, 40%)
  • Output: rgb(51, 102, 153)

Advantages of Using HSL to RGB Converter

  • Instant Results: No manual calculations required.
  • High Accuracy: Ensures perfect conversion.
  • Easy to Use: Just input values and copy results.
  • Universal Application: Works for web design, digital art, and branding.

Frequently Asked Questions (FAQs)

What’s the difference between HSL and RGB?

HSL defines color in terms of hue, saturation, and lightness, while RGB uses red, green, and blue values.

Can I convert RGB back to HSL?

Yes, you can use an RGB to HSL converter for reverse conversion.

Which is better – HSL or RGB?

HSL is better for editing and adjusting, while RGB is better for implementation on screens.

Do all browsers support RGB?

Yes, RGB and RGBA are fully supported in all major browsers.

Can I use decimal HSL values in the converter?

Yes, as long as they follow valid HSL formatting.

Why do designers prefer HSL for adjustments?

Because it makes it easier to control shades, tones, and brightness compared to RGB.

Is there any restriction on the number of conversions?

No, you can convert as many HSL values to RGB as you like.

Do you want more articles on React, Next.js, Tailwind CSS, and JavaScript?

Subscribe to my newsletter to receive articles straight in your inbox.

If you like my work and want to support me, consider buying me a coffee.

Buy Me A Coffee

Contact Me ☎️

Discuss A Project Or Just Want To Say Hi?
My Inbox Is Open For All.

Mail : contact@mridul.tech

Connect with me on Social Media

Contact Art