HEX / RGB / HSL Color Converter

Enter a color in HEX, RGB or HSL and instantly see it converted to all three formats with a live color preview. Copy any format with one click.

#22176c
rgb(34, 23, 108)
hsl(248, 65%, 26%)

Privacy: your input is processed entirely in your browser and is never sent to our servers.

How to Use HEX / RGB / HSL Color Converter

  1. 1Choose an input format: HEX, RGB or HSL.
  2. 2Enter your color values.
  3. 3Read the converted values and copy the one you need.

What This Tool Does

Colors are represented differently across CSS, design tools and code, and converting between formats by hand is tedious and error prone. HEX is the compact format most common in CSS, RGB describes a color as red, green and blue intensities that map intuitively to screens, and HSL expresses a color as hue, saturation and lightness, which makes adjusting tints and shades far easier. This converter translates between all three formats instantly and shows a live preview so you can confirm the color before copying. Enter a value in any one format and read off the other two, copy whichever you need, and use the preview to verify the result. Short HEX codes such as #abc are expanded automatically.

Examples

Matching a brand color

Enter a brand HEX value to get the matching RGB and HSL values for use across CSS, design tools and documentation in one pass.

Creating a tint

Convert a color to HSL and raise the lightness to produce a lighter tint of the same hue, then copy the result back as HEX for CSS.

Helpful Tips

  • HSL is handy for creating tints and shades of a single hue.
  • HEX is the most compact format for CSS.
  • Use the preview to confirm the color before copying.

Frequently Asked Questions

Does it support alpha transparency?

This tool converts opaque colors. Use rgba or hsla in CSS for transparency.

Are three-digit HEX codes supported?

Yes, short HEX codes like #abc are expanded automatically.

What if I enter invalid values?

A clear error is shown and no conversion is produced.

Related Tools