Hex to RGB Color Converter

Convert hexadecimal color codes to RGB values instantly. Extract color components, preview colors, and get detailed color information.

Hex to RGB Conversion: Hexadecimal color codes (like #FF5733) represent colors using three pairs of hexadecimal digits for Red, Green, and Blue components.

Each pair (RR, GG, BB) ranges from 00 to FF (0 to 255 in decimal).

#
Enter a 6-digit hex color code (without #) or a 3-digit shorthand code. Letters can be uppercase or lowercase.
#2c7da0
RGB(44, 125, 160)
#e83e8c
RGB(232, 62, 140)
#28a745
RGB(40, 167, 69)
#ffc107
RGB(255, 193, 7)
#dc3545
RGB(220, 53, 69)
#6f42c1
RGB(111, 66, 193)
Choose how you want the RGB values displayed
Hex Color
#2c7da0
RGB Color
RGB(44, 125, 160)
Converting...
Color Conversion Results
Red
44
Decimal
Green
125
Decimal
Blue
160
Decimal
Adjust RGB Components
Red 44
Green 125
Blue 160
Color in Different Formats
Format Syntax Value Action
Hexadecimal #RRGGBB #2c7da0
RGB RGB(r, g, b) RGB(44, 125, 160)
RGB Percentage RGB(r%, g%, b%) RGB(17.3%, 49.0%, 62.7%)
CSS rgb() rgb(r, g, b) rgb(44, 125, 160)
CSS rgba() rgba(r, g, b, a) rgba(44, 125, 160, 1)
Python Tuple (r, g, b) (44, 125, 160)
JavaScript Array [r, g, b] [44, 125, 160]
Color Harmony
Complementary
#a07d2c
Analogous
#2ca07d
Original
#2c7da0
Analogous
#2c5aa0
Triadic
#a02c7d
Triadic
#7da02c

These are harmonizing colors that work well with your selected color in design projects.

Understanding Hexadecimal and RGB Colors

Hexadecimal color codes and RGB (Red, Green, Blue) are two common ways to represent colors in digital design, web development, and computer graphics.

Hexadecimal Color Codes:

Hexadecimal colors are represented by a 6-digit code prefixed with a hash (#). Each pair of digits represents the intensity of Red, Green, and Blue components:

#RRGGBB

Where RR (red), GG (green), and BB (blue) are hexadecimal values ranging from 00 to FF (0 to 255 in decimal).

RGB Color Model:

The RGB color model is an additive color model in which red, green, and blue light are added together in various ways to reproduce a broad array of colors. Each component can range from 0 to 255.

RGB(0, 0, 0) is black, RGB(255, 255, 255) is white, and RGB(255, 0, 0) is pure red.

Conversion Formula

Hex to Decimal Conversion:

Each hexadecimal digit represents 4 bits (a nibble). Two hexadecimal digits represent one byte (8 bits).

To convert a hexadecimal pair to decimal:

Decimal = (First Digit × 16) + Second Digit

Where hexadecimal digits A-F represent decimal values 10-15.

Example: Hex "2C" = (2 × 16) + 12 = 32 + 12 = 44

Common Color Code Formats

Format Example Description Usage
6-digit Hex #2c7da0 Standard hexadecimal color code Web design, CSS, HTML
3-digit Hex #2a8 Shorthand for #22aa88 CSS shorthand notation
RGB RGB(44, 125, 160) Red, Green, Blue values (0-255) CSS, graphic design
RGBA RGBA(44, 125, 160, 0.5) RGB with alpha transparency (0-1) CSS with transparency
HSL HSL(198°, 57%, 40%) Hue, Saturation, Lightness CSS, intuitive color adjustment
HSLA HSLA(198°, 57%, 40%, 0.5) HSL with alpha transparency CSS with transparency

Color Theory Basics

1

Additive Color Model: RGB is an additive color model used for screens. Red, green, and blue light are combined to create colors. When all three are at maximum intensity, white is produced.

2

Hexadecimal Notation: Base-16 numbering system using digits 0-9 and letters A-F. Each hex digit represents 4 bits, so two hex digits represent one byte (0-255 in decimal).

3

Color Depth: Standard RGB uses 8 bits per channel (24-bit color), allowing for 16.7 million possible colors. High color modes use 10, 12, or 16 bits per channel for greater precision.

Applications of Hex and RGB Colors

  • Web Design: CSS styling, background colors, text colors
  • Graphic Design: Digital artwork, logos, branding materials
  • User Interfaces: Button colors, themes, visual feedback
  • Data Visualization: Charts, graphs, heatmaps
  • Game Development: Textures, lighting, visual effects
  • Digital Photography: Color correction, image editing

Converter Features:

  • Converts 6-digit and 3-digit hex codes to RGB values
  • Provides color preview and multiple output formats
  • Includes RGB component sliders for fine-tuning
  • Generates color harmonies for design inspiration
  • Offers copy functionality for all color formats
  • Includes popular color examples for quick testing

Frequently Asked Questions

A 6-digit hex code like #FF5733 uses two digits for each color channel (RR, GG, BB). A 3-digit hex code like #F53 is shorthand where each digit is duplicated: #F53 becomes #FF5533. This shorthand only works when each pair consists of the same digit.

Hexadecimal notation is more compact than decimal for representing binary data. Since computers work in binary and colors are stored as binary values, hex provides a more human-readable representation that aligns with how computers store color data (one hex digit = 4 bits, two hex digits = 1 byte).

In standard 8-bit per channel RGB, each component (Red, Green, Blue) ranges from 0 to 255. This gives 256 possible values per channel, resulting in 256 × 256 × 256 = 16,777,216 possible colors (24-bit color depth).

To convert RGB to hex: 1) Convert each decimal value (0-255) to hexadecimal, 2) Ensure each result is two digits (pad with 0 if needed), 3) Combine them in RRGGBB order, 4) Prefix with #. For example, RGB(44, 125, 160) becomes #2C (44), #7D (125), #A0 (160) = #2C7DA0.

Web-safe colors are a palette of 216 colors that display consistently across different browsers and operating systems. Each RGB component in a web-safe color is one of these values: 0, 51, 102, 153, 204, 255. In hex, these are: 00, 33, 66, 99, CC, FF. While less important today with modern displays, they were crucial in the early web.