HEX to RGB Converter

HEX to RGB Converter

Convert hexadecimal color codes to RGB values with live color preview. Perfect for web design, CSS, and digital art projects.

Last updated: March 2026 | By Patchworkr Team

Convert Color

Supports 3-digit (#F00) and 6-digit (#FF0000) formats
Color Preview
#FF6432
Red
255
Green
100
Blue
50
HEX
#FF6432
RGB
rgb(255, 100, 50)
RGB (separate)
255, 100, 50

What are HEX and RGB Colors?

HEX (hexadecimal) and RGB (Red, Green, Blue) are two different ways of representing the same colors in digital design. Both methods specify colors by combining different intensities of red, green, and blue light, but they express these values in different formats.

RGB uses decimal numbers from 0 to 255 for each color channel, making it intuitive and human-readable. For example, rgb(255, 100, 50) represents maximum red, moderate green, and low blue. HEX uses base-16 (hexadecimal) notation with values from 00 to FF (0 to 255 in decimal). The same color would be #FF6432 in HEX format.

HEX codes are compact and widely used in web design, CSS, and HTML because they're shorter to write. RGB is more common in image editing software and programming where you need to manipulate individual color channels. Both formats can represent the same 16.7 million colors (256 × 256 × 256).

Understanding Color Formats

HEX Color Code Structure

A HEX code consists of three pairs of hexadecimal digits:

#RRGGBB
RR = Red channel (00 to FF)
GG = Green channel (00 to FF)
BB = Blue channel (00 to FF)
Short form (#RGB) expands by doubling each digit: #F00 → #FF0000

Hexadecimal to Decimal Conversion

Hexadecimal uses 16 digits (0-9, A-F) where A=10, B=11, ..., F=15:

Common Values:
00 = 0 (minimum)
80 = 128 (half)
FF = 255 (maximum)
Examples:
FF = (15×16) + 15 = 255
A0 = (10×16) + 0 = 160
1F = (1×16) + 15 = 31

Common Color Examples

Red
#FF0000
Green
#00FF00
Blue
#0000FF
Yellow
#FFFF00
Magenta
#FF00FF
Cyan
#00FFFF
White
#FFFFFF
Black
#000000

Example Conversion

Let's convert #FF6432 to RGB:

Given:
HEX Code: #FF6432
Step 1:
Split into color channels:
Red (RR) = FF
Green (GG) = 64
Blue (BB) = 32
Step 2:
Convert each channel to decimal:
Red: FF = (15 × 16) + 15 = 255
Green: 64 = (6 × 16) + 4 = 100
Blue: 32 = (3 × 16) + 2 = 50
Result:
rgb(255, 100, 50)
This creates an orange-red color with full red intensity, moderate green, and low blue

Frequently Asked Questions

What's the difference between #RGB and #RRGGBB?

The 3-digit format (#RGB) is a shorthand where each digit is doubled. #F00 expands to #FF0000 (red). The 6-digit format provides more precision with 256 values per channel instead of 16. Use 3-digit for simple colors, 6-digit for exact shades.

Why does CSS use HEX instead of RGB?

Both are valid in CSS! HEX is more compact (#FF0000 vs rgb(255, 0, 0)) and has been traditional in web design. However, rgb() and rgba() are gaining popularity because they're more readable and rgba() supports transparency, which HEX doesn't (unless using 8-digit format #RRGGBBAA).

What's the # symbol for?

The # (hash/pound symbol) indicates that what follows is a hexadecimal color code. In HTML, CSS, and most programming contexts, the # is required. Without it, the browser won't recognize it as a color. Some design tools may accept HEX codes without the #.

Can HEX represent all colors?

HEX can represent all 16,777,216 colors (256³) in the standard RGB color space (sRGB). However, it can't represent colors outside this gamut, like those in wider color spaces (Display P3, Adobe RGB) or specialty colors (Pantone, CMYK for print).

What does each RGB value represent?

Each RGB value (0-255) represents the intensity of that color channel. 0 means that color is off, 255 means it's at maximum brightness. rgb(255, 0, 0) is pure red. rgb(128, 128, 128) is medium gray because all channels are at half intensity.

How do I create grayscale colors?

Grayscale colors have equal values for all three RGB channels. #000000 (0,0,0) is black, #FFFFFF (255,255,255) is white, and #808080 (128,128,128) is medium gray. Any color where R=G=B will be a shade of gray.

What's the difference between RGB and RGBA?

RGBA adds an alpha (transparency) channel. rgb(255, 0, 0) is opaque red, while rgba(255, 0, 0, 0.5) is 50% transparent red. HEX has an 8-digit format (#RRGGBBAA) for transparency, but the 6-digit format is always fully opaque.

Which format should I use in my code?

Use HEX for solid colors in CSS when you want concise code. Use rgb()/rgba() when you need transparency or when you're programmatically manipulating colors (easier to adjust individual channels). Many modern developers prefer rgb() for better readability.

Related Tools