Use this free color converter to translate a color between HEX, RGB, and HSL. Enter a value or pick a color, choose your primary format, and click Convert. The swatch shows the color, and every format is listed so you can copy the one your project needs.

Use HEX for stylesheets and design tools, RGB when you need to work with channels, and HSL when you want to adjust lightness or saturation by hand.

How to use the color converter

  • Enter a color: type a HEX, rgb(), or hsl() value, or use the color picker.
  • Choose a primary format: HEX, RGB, or HSL. This is the value Copy places on your clipboard.
  • Set HEX case: uppercase or lowercase, to match your style guide.
  • Copy or download: copy the primary value, or download all three formats as a .txt file.

Supported formats

FormatExampleNotes
HEX#1E90FFSix digits, or three digits as a shorthand such as #1E9
HEX with alpha#1E90FF80Eight digits, where the last pair sets transparency
RGBrgb(30, 144, 255)Red, green, and blue from 0 to 255
RGBArgba(30, 144, 255, 0.5)RGB with an alpha value from 0 to 1
HSLhsl(210, 100%, 56%)Hue in degrees, saturation and lightness as percentages
HSLAhsla(210, 100%, 56%, 0.5)HSL with an alpha value from 0 to 1

Common color values

ColorHEXRGBHSL
White#FFFFFFrgb(255, 255, 255)hsl(0, 0%, 100%)
Black#000000rgb(0, 0, 0)hsl(0, 0%, 0%)
Red#FF0000rgb(255, 0, 0)hsl(0, 100%, 50%)
Green#008000rgb(0, 128, 0)hsl(120, 100%, 25%)
Blue#0000FFrgb(0, 0, 255)hsl(240, 100%, 50%)

Common mistakes

  • Missing the hash: the tool accepts HEX with or without #, but some code editors need it, so keep it when you copy.
  • Percent signs in HSL: saturation and lightness are percentages, so write 50%, not 0.5, in hsl().
  • Alpha scale: in rgba() and hsla() the alpha value runs from 0 to 1, while the last pair of an 8-digit HEX code runs from 00 to FF.
  • Rounding: RGB values are whole numbers, so a round trip through HSL can shift a channel by one unit.
Checking a color in every format before you commit it helps keep your stylesheet, design files, and code using the same value.

Worked examples

Turn a brand HEX into RGB

Enter #1E90FF and click Convert. The RGB result is rgb(30, 144, 255), which you can use in a CSS variable or a canvas call that expects channel values.

Find the HSL for a lighter tint

Enter #1E90FF and read the HSL line, hsl(210, 100%, 56%). Raise the lightness value to make a lighter shade of the same hue.

Convert a semi-transparent color

Enter rgba(30, 144, 255, 0.5). The HEX result is #1E90FF80, and the swatch shows the color with the same transparency.

Frequently asked questions

Is this color converter free to use?

Yes. You can convert, copy, and download colors without creating an account.

Is my color data uploaded or stored?

No. All conversion happens in your browser. Nothing you enter is sent to a server or saved, and clearing the form removes it from the screen.

Which color formats are supported?

HEX with 3, 6, or 8 digits, rgb() and rgba(), and hsl() and hsla(). Named colors such as “tomato” are not converted yet, so use the HEX value for them.

Why does the HSL value look slightly different from my input?

HSL is calculated from the RGB channels, and those are rounded to whole numbers. The color is the same, but the hue, saturation, or lightness may differ by a unit.

What happens to transparency?

If your input includes an alpha value, the converter keeps it. HEX becomes an 8-digit code, and RGB and HSL switch to rgba() and hsla().

Can I use this for picking colors from an image?

No. This tool converts colors you enter or choose. To read a color from a photo, use an eyedropper tool in your image editor, then paste the HEX value here.

Share this article