Logocolorspicker.net

Convert HEX to RGB online

Paste a HEX code with or without the # sign, three or six characters long. The RGB numbers appear next to it, ready to copy.

How to convert HEX to RGB

  1. Split the code into three pairs. The first is red, the second is green and the third is blue.
  2. In each pair, multiply the first character by 16 and add the second. A to F stand for 10 to 15.
  3. Example: in #4169E1, 41 is 4 x 16 + 1 = 65, 69 is 6 x 16 + 9 = 105, and E1 is 14 x 16 + 1 = 225. So it is RGB 65, 105, 225.
const hexToRgb = hex =>
  hex.replace('#', '').match(/../g).map(pair => parseInt(pair, 16));

hexToRgb('#4169E1'); // [65, 105, 225]

HEX to RGB table of common colors

ColorHEXRGB
Black#0000000, 0, 0
White#FFFFFF255, 255, 255
Gray#808080128, 128, 128
Red#FF0000255, 0, 0
Maroon#800000128, 0, 0
Orange#FFA500255, 165, 0
Gold#FFD700255, 215, 0
Yellow#FFFF00255, 255, 0
Green#0080000, 128, 0
Teal#0080800, 128, 128
Cyan#00FFFF0, 255, 255
Blue#0000FF0, 0, 255
Navy Blue#0000800, 0, 128
Purple#800080128, 0, 128
Magenta#FF00FF255, 0, 255
Pink#FFC0CB255, 192, 203

Frequently asked questions

What does a three-character HEX code mean?

It is a short form: every character is doubled. #F60 is the same as #FF6600, or RGB 255, 102, 0.

Does capitalization matter in HEX codes?

No. #ffb6c1 and #FFB6C1 are the same color.

Which one should I use in CSS, HEX or RGB?

Browsers treat them the same. HEX is shorter, while rgb() is easier to read and lets you add opacity, as in rgb(65 105 225 / 50%).

HEX to RGB Converter: Color Code, Formula & Table