Skip to content

Color Tools

HEX to RGB

Paste or pick a hex color and get the matching rgb() value instantly.

  • Free
  • No sign-up
  • Runs in your browser

Guide

What is the relationship between HEX and RGB?

HEX and RGB describe the same colors in two notations. RGB lists the amount of red, green and blue as three numbers from 0 to 255. A hex code writes those same three numbers in base 16, two characters each, after a # sign.

So #5B4FF0 splits into 5B, 4F and F0. Converting each pair from base 16: 5B is 5 x 16 + 11 = 91, 4F is 4 x 16 + 15 = 79, and F0 is 15 x 16 + 0 = 240. That gives rgb(91, 79, 240).

The tool also accepts the three-digit shorthand, where each character is doubled, so #fa0 is read as #ffaa00.

Why you might need the RGB form

Hex codes dominate design handoffs and brand guides, but plenty of places want separate channel values: image editors, game engines, charting libraries, and CSS functions such as rgb() or rgba() when you need to add transparency.

Converting is also the first step if you want to adjust one channel by a specific amount, because it is far easier to add 20 to a number than to edit a base-16 pair in your head.

If you need to go the other way, use the RGB to HEX converter. For hue-based editing, the HEX to HSL converter is the better fit.

How to convert a HEX code to RGB

  1. Type or paste the code into the HEX color text box. The default is #5B4FF0, and the leading # is optional.
  2. Alternatively, click the small color swatch next to the box to pick a color visually. The text box updates to its hex value.
  3. Read the result in the panel below, written as rgb(r, g, b), and check the preview swatch to confirm it is the color you meant.

Worked example: #FF8800 gives FF = 255, 88 = 8 x 16 + 8 = 136, and 00 = 0. The result is rgb(255, 136, 0), a bright orange.

The tool runs in your browser, so your values stay on your device. There is no copy button, so select the displayed text to copy it.

Mistakes to avoid

The converter only handles six-digit codes and the three-digit shorthand. An eight-digit code with an alpha channel (such as #5B4FF0CC) is not valid input here, and you will see a prompt to enter a valid 6-digit hex color instead.

Typos are the usual cause of that message. Hex digits only run from 0 to 9 and A to F, so a G or an O will not parse. Letter case does not matter.

Remember that the picker shows only fully opaque colors. If your design needs transparency, convert the color first and add the alpha value yourself when you write the rgba() CSS.

Frequently asked questions

Do I need to include the # symbol?

No. The converter strips a leading # if present, so 5B4FF0 and #5B4FF0 produce the same result.

Does it support 8-digit hex codes with transparency?

No. It accepts six-digit codes and three-digit shorthand only. Other lengths show a message asking for a valid 6-digit hex color.

Is the hex value case sensitive?

No. Uppercase and lowercase letters are read the same way, so #ff8800 and #FF8800 give the same RGB result.