Free Color Tool

HEX to RGB Converter: Turn Hex Color Codes into RGB

Paste a hex code like #1E90FF and get its RGB values instantly, with a live preview. Handles shorthand and transparency. Free, no signup.

3, 6 & 8-digit hex RGB & RGBA output Live preview CSS-ready Line-by-line mode One-click copy No signup

Convert Hex Codes to RGB Instantly

Designers hand over hex codes, but plenty of places want RGB instead: CSS with transparency, Android and iOS code, Excel's color settings, game engines and LED controllers. Paste the hex code, copy the RGB values, and skip the mental math in base 16.

Read more
Hex pairs converted into red, green and blue values

How Hex to RGB Conversion Works

A hex color is three pairs of base-16 digits: one each for red, green and blue. Each pair converts to a number from 0 to 255. Take #1E90FF: 1E = (1 × 16) + 14 = 30 (red) 90 = (9 × 16) + 0 = 144 (green) FF = (15 × 16) + 15 = 255 (blue) So #1E90FF is rgb(30, 144, 255). The converter does this for you, but it's handy to know when you want to sanity-check a code by eye.

Three-digit shorthand and eight-digit hex with alpha converted to RGBA

Shorthand and 8-Digit Hex Codes

Three-digit codes are shorthand: each digit is doubled, so #F0C means #FF00CC, which is rgb(255, 0, 204). Eight-digit codes add an alpha (transparency) pair at the end, sometimes called HEXA. #1E90FF80 converts to rgba(30, 144, 255, 0.5), because 80 in hex is 128, about half of 255.

Color swatch preview revealing a mistyped hex digit

Live Preview to Catch Typos

Every conversion shows a color swatch. If you meant blue and see orange, you'll know a digit got swapped before it ends up in your code.

List of hex codes converted to RGB line by line

Convert a Whole Palette at Once

Turn on Convert each line separately and paste a list of hex codes, one per line, to get the RGB values for an entire brand palette or theme in one pass.

Table of common colors with their HEX and RGB values

Common Hex to RGB Colors

White: #FFFFFF = 255, 255, 255 Black: #000000 = 0, 0, 0 Red: #FF0000 = 255, 0, 0 Lime green: #00FF00 = 0, 255, 0 Blue: #0000FF = 0, 0, 255 Yellow: #FFFF00 = 255, 255, 0 Orange: #FFA500 = 255, 165, 0 Gray: #808080 = 128, 128, 128 Navy: #000080 = 0, 0, 128 Dodger blue: #1E90FF = 30, 144, 255

How to Convert Hex to RGB

1

Paste your hex code

Enter a hex color code with or without the #, for example #1E90FF or 1e90ff. Click Sample to try one.
2

Choose the output

Pick CSS format to get rgb(30, 144, 255), or plain numbers for apps that ask for separate R, G and B values.
3

Click Convert

The tool turns each hex pair into a number from 0 to 255 and shows a preview of the color.
4

Copy the RGB values

Paste them into your stylesheet, design app or code. Click Clear for the next color.

HEX to RGB FAQs

Answers about converting hex color codes to RGB.

How do I convert hex to RGB?

Paste the hex code into the box and click Convert. To do it by hand, split the code into three pairs and convert each from base 16 to base 10. The first pair is red, the second is green and the third is blue.

What is #FFFFFF in RGB?

#FFFFFF is rgb(255, 255, 255), which is pure white. At the other end, #000000 is rgb(0, 0, 0), pure black.

Do I need the # symbol?

Not here. You can paste 1E90FF or #1E90FF and both work. In CSS, though, hex colors always need the # in front.

How do I convert an 8-digit hex (HEXA) to RGBA?

The first six digits give red, green and blue as usual. The last two are alpha: convert them to a number from 0 to 255 and divide by 255. So #FF000080 becomes rgba(255, 0, 0, 0.5).

Can I convert hex to RGB in Excel?

Yes, with a formula. If the hex code (without the #) is in cell A1, red is =HEX2DEC(LEFT(A1,2)), green is =HEX2DEC(MID(A1,3,2)) and blue is =HEX2DEC(RIGHT(A1,2)).

How do I convert hex to RGB in JavaScript or Python?

In JavaScript, parseInt('1E', 16) returns 30, so run it on each pair. In Python, tuple(int('1E90FF'[i:i+2], 16) for i in (0, 2, 4)) returns (30, 144, 255).

Is hex or RGB better?

Neither is more accurate; they're the same color written two ways. Hex is shorter and common in design handoffs. RGB is easier to read and tweak, and lots of software asks for separate red, green and blue values.

Is "colour hex to RGB" any different?

No, that's just the British spelling. Colour or color, the conversion works exactly the same.

Need it the other way round?

Turn RGB values back into a hex code with RGB to HEX, or get HSL and CMYK as well with our Color Converter.

RGB to HEX

Raheel Jakhura

CEO / Co-Founder

Our goal is to provide online free tools so you don't have to install any software for basic usages. We are trying to add more tools and make these tools free forever.

cookies image
We care about your data and would love to use cookies to improve your experience.