Hex to RGB Color Converter
Color Picker
Color Shades
Color Combinations
About HEX and RGB Colors
HEX (Hexadecimal) and RGB (Red Green Blue) are two common ways to represent colors in web design and digital media.
RGB (Red, Green, Blue)
RGB is a color model that represents colors as combinations of red, green, and blue light intensities, each ranging from 0 to 255. It's widely used in digital displays, photography, and design because it aligns with how screens emit light. By mixing these three primary colors in varying intensities, RGB can produce millions of colors. For example, pure red is (255, 0, 0)
, while white is (255, 255, 255)
.
HEX (Hexadecimal)
HEX codes are a compact way to represent RGB colors using a six-digit hexadecimal (base-16) notation, prefixed with #
. Each pair of digits corresponds to the red, green, and blue components, with values from 00
to FF
(equivalent to 0-255 in decimal). For instance, #FF0000
is pure red, and #FFFFFF
is white. HEX is commonly used in web design for its brevity and compatibility with HTML/CSS.
HEX to RGB Conversion
- Take the first two digits of the hex code and convert to decimal to get the red value
- Take the middle two digits and convert to decimal for the green value
- Take the last two digits and convert to decimal for the blue value
Example #1
Convert green hex color code 00FF00 to RGB:
Hex = 00FF00
Red = 0016 = 010
Green = FF16 = 25510
Blue = 0016 = 010
RGB = (0, 255, 0)
Example #2
Convert purple hex color code 800080 to RGB:
Hex = 800080
Red = 8016 = 12810
Green = 0016 = 010
Blue = 8016 = 12810
RGB = (128, 0, 128)
Common Hex to RGB Examples in Web Design
- #FFFFFF → rgb(255,255,255) (white)
- #000000 → rgb(0,0,0) (black)
- #3498db → rgb(52, 152, 219) (Bootstrap Blue)
RGB is widely used in web design, digital art, and CSS styling because it directly represents how colors are displayed on screens through combinations of red, green, and blue light.
HEX to RGB FAQ
Can all Hex colors be converted to RGB?
Yes, every valid Hex color code has an exact RGB equivalent since both systems represent the same color spectrum.
Is Hex or RGB better for CSS?
Hex is more compact for solid colors (#FFF vs rgb(255,255,255)), while RGB allows alpha transparency (rgba). Modern CSS accepts both equally.
Are RGB values always between 0–255?
In traditional 8-bit RGB, yes. Newer formats like CSS Color Module Level 4 allow percentage values and wider gamuts.