RGB to HEX Converter

Type RGB values such as rgb(255, 136, 0) to get the HEX code, plus the HSL form and a preview.

Enter a color

Result

HEX #00A86B
rgb(0, 168, 107)
hsl(158, 100%, 33%)

How to use it

  1. Type the RGB values in the RGB box, for example 255, 136, 0.
  2. The HEX code and HSL update as you type.
  3. Copy the HEX code from the result.

About this tool

To convert RGB to HEX, turn each of the red, green and blue values (0 to 255) into a two-digit hexadecimal number and join them after a #. For rgb(255, 136, 0): 255 is FF, 136 is 88 and 0 is 00, giving #FF8800.

Values must be whole numbers from 0 to 255. Single-digit hex results are padded with a zero, so 10 becomes 0A.

Formula

  • HEX = # + hex(R) + hex(G) + hex(B), each padded to two digits.
  • Example: rgb(0, 168, 107) → 00 + A8 + 6B = #00A86B.

Examples

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

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 RGB to HEX?

Convert each of R, G and B to a two-digit hexadecimal number and put them together after #.

What is rgb(0, 0, 0) in HEX?

#000000, which is black. rgb(255, 255, 255) is #FFFFFF, white.

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.