Hex to RGB Color Converter

Formula: R = hex[0:2] to decimal; G = hex[2:4]; B = hex[4:6]

Hex to RGB Converter

Hex and RGB are the two most common ways to specify colors in web development. Converting between them is essential for CSS, design, and accessibility work.

Conversion Formula

R = hex[0:2] to decimal; G = hex[2:4]; B = hex[4:6]

Each pair of hex digits represents one color channel (R, G, B) with values from 00 (0) to FF (255).

Step-by-Step Examples

#FF5733 = R:255, G:87, B:51

FF=255, 57=87, 33=51

#3498DB = R:52, G:152, B:219

34=52, 98=152, DB=219

History

Hex color notation became standard with HTML 2.0 in 1995 and has been the dominant web color format since.

Common Use Cases

  • CSS color specification
  • Design tool conversion
  • Brand color documentation
  • Accessibility checking

Frequently Asked Questions

What is a hex color code?

A hex color code is a 6-digit hexadecimal number representing red, green, and blue color channels (#RRGGBB).

What is the difference between hex and RGB?

They represent the same colors differently. Hex uses base-16 notation; RGB uses decimal values 0-255 for each channel.

Can I use 3-digit hex codes?

Yes, 3-digit hex codes are shorthand where each digit is doubled. #F00 = #FF0000 (red).

What hex code is white?

#FFFFFF (RGB: 255, 255, 255). Black is #000000 (RGB: 0, 0, 0).

Where are hex colors used?

Hex colors are the standard color format in CSS, HTML, and most design tools like Figma and Photoshop.