InovoTools
Developer Tools

Hex to RGB Colour Converter

Convert a hex colour code to RGB and HSL. Paste a code such as #3B82F6 and get rgb(59, 130, 246) ready for CSS, along with the plain channel values for design and print tools.

01

Your inputs

Start with the example, or enter your own values.

Processed in your browser. Your inputs stay on this device.

02

Your result

A little clarity, coming right up.

Make room for the answer.

Enter your values and run the tool. Your result will appear here.

How to use the Hex to RGB Converter

Paste a hex colour code such as #3B82F6. You get the rgb() value, the plain channel numbers and the HSL equivalent.

How hex to RGB conversion works

A six-digit hex code holds three pairs: red, green and blue. Each pair is converted from base 16 to base 10. In #FF5733, FF is 255, 57 is 87 and 33 is 51, giving rgb(255, 87, 51).

Three-digit hex codes

Short codes double each digit, so #F53 means #FF5533. Expand the short form first if a tool only accepts six digits.

How it works

Split the hex code into red, green and blue pairs.

Examples

  • #3B82F6
    rgb(59, 130, 246)
    RGB values: 59, 130, 246
    hsl(217, 91%, 60%)
  • #FF5733
    rgb(255, 87, 51)
    RGB values: 255, 87, 51
    hsl(11, 100%, 60%)
  • #000000
    rgb(0, 0, 0)
    RGB values: 0, 0, 0
    hsl(0, 0%, 0%)

Common hex colours in RGB

HexRGB
#000000rgb(0, 0, 0)
#FFFFFFrgb(255, 255, 255)
#FF0000rgb(255, 0, 0)
#00FF00rgb(0, 255, 0)
#0000FFrgb(0, 0, 255)
#FFFF00rgb(255, 255, 0)
#00FFFFrgb(0, 255, 255)
#FF00FFrgb(255, 0, 255)
#808080rgb(128, 128, 128)
#FFA500rgb(255, 165, 0)
#800080rgb(128, 0, 128)
#000080rgb(0, 0, 128)

Limitations and assumptions

Runs entirely in your browser. Nothing you enter is uploaded.

Frequently asked questions

What is #000000 in RGB?

rgb(0, 0, 0), which is black.

Can I use the RGB result in CSS?

Yes. Copy the rgb() value straight into a stylesheet; browsers render it exactly like the hex code.

How do I convert RGB back to hex?

Use the RGB to hex converter.