How to convert Hex to RGB

How to convert Hex to RGB

The Hex color code is the digits hexadecimal number of base 16. This can be expressed as; RRGGBB16.

Where;

The left 2 digits represent the red color (RR), the 2 middle digits represent the green color (GG) and the 2 right represent represents the blue color (BB).

The RGB color code is a combination of Red, Green and Blue colors. (R, G, B). The red, green and blue colors have integer values from 0 to 255 and each uses 8 bits. Thus the number of colors that can be generated is;

256×256×256 = 16777216 = 100000016

Formula for converting Hex to RGB

To get the red color level, get the 2 digits of the hex color code and convert them into a decimal value.

To get the green color level, we take the 2 middle digits of the hex color code and then convert them to decimal value.

To get the blue color level, we take the 2 right digits of the hex color code and then convert them to a decimal value.

Example one

Convert the gold hex color code FFD8700 to RGB color

Hex = FFD700

Therefore, the RGB colors will be;

R = FF16 = 25510

G = D716 = 21510

B = 0016 = 010

They can also be expressed as;

RGB = (255, 215, 0)

Example two

Convert the red hex color code FF0000 to RGB color.

Hex = FF0000

Therefore, the RGB colors will be;

R = FF16 = 25510

G = 0016 = 010

B = 0016 = 010

They can also be expressed as;

RGB = (255, 0, 0)

The Hex to RGB conversion calculator gives accurate conversion results depending on what you enter in the bank text fields. You can also use the Hex to RGB conversion table to determine some of the common color code conversions from Hex to RGB.

Related Conversion