HEX to RGB Color Converter

Hex Color
R
G
B

HEX to RGB Color Converter

What is HEX to RGB Conversion?

HEX to RGB conversion is the process of transforming color representations from the hexadecimal (HEX) color code to the RGB (Red, Green, Blue) color model. This conversion is useful when you need to translate web-friendly color codes into values that can be used in digital displays and image processing.

HEX Color Code

A HEX color code is a six-digit combination of numbers and letters defined by its mix of red, green and blue (RGB). It's preceded by a pound sign (#) and can be found in CSS and HTML color code.

  • Format: #RRGGBB
  • RR: Red value (00 to FF)
  • GG: Green value (00 to FF)
  • BB: Blue value (00 to FF)

RGB Color Model

The RGB color model represents colors using three components:

  • Red (R): Amount of red, from 0 to 255.
  • Green (G): Amount of green, from 0 to 255.
  • Blue (B): Amount of blue, from 0 to 255.

Conversion Formula

The conversion from HEX to RGB is straightforward:

1. Split the HEX code into three parts: RR, GG, and BB.

2. Convert each part from base 16 (hexadecimal) to base 10 (decimal).

For example, to convert #1A8F3C:

  • R: 1A (hex) = 26 (decimal)
  • G: 8F (hex) = 143 (decimal)
  • B: 3C (hex) = 60 (decimal)

Therefore, #1A8F3C in RGB is (26, 143, 60).

Usage Example

Let's convert a vibrant blue color from HEX to RGB:

  • HEX: #007FFF
  • RGB: (0, 127, 255)

Visual Representation

HEX RGB

This diagram shows the vibrant blue color represented in both HEX and RGB formats. The visual appearance is identical, demonstrating the accurate conversion between the two color representations.