HEX to RGB Converter

Type a HEX color code to get its RGB values, plus the HSL form and a preview.

Enter a color

Result

HEX #1E90FF
rgb(30, 144, 255)
hsl(210, 100%, 56%)

How to use it

  1. Type a color in HEX, RGB or HSL, or use the color picker.
  2. The other formats update as you type.
  3. Copy the format you need from the result.

About this tool

A HEX code has three pairs of hexadecimal digits for red, green and blue. To get RGB, convert each pair to decimal: in #1E90FF, 1E is 30, 90 is 144 and FF is 255, so the color is rgb(30, 144, 255).

A three-digit code is shorthand where each digit is doubled, so #F80 means #FF8800. The # sign is optional here.

Formula

  • R = first pair, G = second pair, B = third pair, each converted from base 16 to base 10.
  • Example: #FF8800 → R = FF = 255, G = 88 = 136, B = 00 = 0.

Examples

  • #FF0000 = rgb(255, 0, 0) = hsl(0, 100%, 50%)
  • #FF8800 = rgb(255, 136, 0) = hsl(32, 100%, 50%)
  • #1E90FF = rgb(30, 144, 255) = hsl(210, 100%, 56%)
  • #00A86B = rgb(0, 168, 107) = hsl(158, 100%, 33%)

Tips

  • A 3-digit HEX such as #F80 is shorthand for #FF8800.
  • Use HSL when you want to make a color lighter or darker: change only the lightness.
  • Check text and background contrast before you use a color pair on a page.

Questions and answers

How do I convert #FF8800 to RGB?

FF is 255, 88 is 136 and 00 is 0, so it is rgb(255, 136, 0).

Does it accept 3-digit HEX codes?

Yes. #F80 is read as #FF8800.

Are my colors saved or sent anywhere?

No. The conversion runs in your browser on your own device. Nothing you type is sent to Paul Digital or any other server.

More tools

Privacy

The conversion runs in your browser on your own device. Nothing you type is sent to Paul Digital or any other server. Colors may look slightly different on different screens.