Hex to RGB converter

Type or paste a hex code to get its RGB values.

How hex to RGB works

A hex code is three two-digit numbers written in base 16: red, green, then blue. Each pair runs from 00 (0) to FF (255). Converting means reading each pair as a normal number.

Common colors in hex and RGB

ColorHEXRGB
Red#FF0000rgb(255, 0, 0)
Green#008000rgb(0, 128, 0)
Blue#0000FFrgb(0, 0, 255)
Black#000000rgb(0, 0, 0)
White#FFFFFFrgb(255, 255, 255)
Gray#808080rgb(128, 128, 128)
Navy Blue#000080rgb(0, 0, 128)
Teal#008080rgb(0, 128, 128)
Sage Green#9CAF88rgb(156, 175, 136)
Burgundy#800020rgb(128, 0, 32)
Lavender#E6E6FArgb(230, 230, 250)
Gold#FFD700rgb(255, 215, 0)
Coral#FF7F50rgb(255, 127, 80)
Hot Pink#FF69B4rgb(255, 105, 180)
Beige#F5F5DCrgb(245, 245, 220)
Charcoal#36454Frgb(54, 69, 79)

Questions

How do you convert hex to RGB?
Split the six digits into three pairs and convert each pair from base 16 to base 10. For #9CAF88: 9C = 9×16 + 12 = 156, AF = 10×16 + 15 = 175, 88 = 8×16 + 8 = 136, so the RGB value is 156, 175, 136.
What about 3-digit hex codes?
Double each digit first: #F80 is the same as #FF8800, which is RGB 255, 136, 0.
What is an 8-digit hex code?
The last two digits are the alpha (opacity) channel. #9CAF8880 is #9CAF88 at about 50% opacity.

More color tools