HEX Color Codes
HEX is a compact hexadecimal notation commonly used to represent RGB colors in websites, applications, design systems, and digital graphics.
Enter any hex color (#3, #6 or #8 digits) and get RGB instantly — plus RGBA, RGB%, HSL, OKLCH, CSS snippets and a live preview.
Input HEX
Accepts #RGB, #RGBA, #RRGGBB, #RRGGBBAA, with or without the leading #. Whitespace is ignored.
Channel preview
Quick presets
Harmonies
Click a swatch to load it into the converter.
Live preview
Text on white, muted text, and a button using your color as its background.
Channel values
Contrast checks (WCAG 2, 4.5:1)
Convert HEX color codes to RGB values online with a fast and easy color converter. Get red, green, and blue values for CSS, web design, UI development, graphics, digital branding, and color analysis.
HEX is a compact hexadecimal notation commonly used to represent RGB colors in websites, applications, design systems, and digital graphics.
RGB describes a color using red, green, and blue channels. Each standard 8-bit channel normally ranges from 0 to 255.
RGB values can be used in CSS, graphics software, JavaScript interfaces, design systems, and many other digital color workflows.
A HEX to RGB Converter is an online color conversion tool that changes a hexadecimal color code into its corresponding red, green, and blue values. The conversion is useful for web designers, developers, graphic designers, UI/UX professionals, and anyone working with digital colors.
HEX and RGB are two different ways of representing colors. A HEX color such as #3366CC contains three pairs of hexadecimal characters. Each pair represents one RGB channel.
RGB uses three numerical channels: red, green, and blue. In the standard 8-bit representation, each channel has a value from 0 to 255.
For example, the HEX value #3366CC converts to RGB(51, 102, 204).
Converting between HEX and RGB is useful because different tools, programming languages, design applications, and CSS workflows may require different color formats.
A six-digit HEX color contains three pairs of hexadecimal values. The first pair represents red, the second represents green, and the third represents blue. Converting each hexadecimal pair into decimal produces the familiar RGB values.
A HEX color code is a hexadecimal representation of a color. On the web, the most common six-digit HEX notation begins with a hash symbol followed by six hexadecimal characters.
Hexadecimal uses sixteen symbols: 0 through 9 and A through F. This allows each pair of hexadecimal characters to represent a number from 0 through 255.
For example:
#FF6600
In this color, FF is the red channel, 66 is the green channel, and 00 is the blue channel.
HEX notation is popular because it is compact and easy to use directly in CSS and many design tools.
RGB stands for Red, Green, and Blue. It is an additive color model used extensively for digital displays and computer graphics.
In the common 8-bit RGB model, each channel can contain a value from 0 to 255. Combining the three channels produces millions of possible colors.
Controls the red component of the color from 0 to 255.
Controls the green component of the color from 0 to 255.
Controls the blue component of the color from 0 to 255.
When all three channels are zero, the result is black. When all three channels are 255, the result is white.
HEX to RGB conversion is straightforward because the standard six-digit HEX format directly represents the three RGB channels. Each two-character hexadecimal pair is converted into a decimal number.
Start with a valid six-digit HEX value such as #3366CC.
Divide the code into three pairs: 33, 66, and CC.
Convert each hexadecimal pair into its decimal equivalent.
Combine the three decimal values as RGB(red, green, blue).
#3366CC
33 → 51
66 → 102
CC → 204
Each two-character hexadecimal value can be converted into a decimal RGB value. Hexadecimal uses base 16, while standard RGB channel values are commonly represented in decimal from 0 to 255.
For a HEX value written as:
#RRGGBB
The first pair RR represents red, the second pair GG represents green, and the third pair BB represents blue.
Mathematically, a hexadecimal pair can be interpreted as:
Decimal = first hexadecimal digit × 16 + second hexadecimal digit
For example, hexadecimal 2A becomes:
2 × 16 + 10 = 42
Therefore, the HEX channel 2A corresponds to the RGB channel value 42.
CSS also supports a shorthand three-digit HEX notation. Instead of six hexadecimal characters, a three-digit value contains one hexadecimal character for each RGB channel.
For example:
#F60
The shorthand expands each digit by repeating it:
#F60 → #FF6600
The expanded value can then be converted into RGB:
#FF6600 → RGB(255, 102, 0)
This shorthand is convenient for simple colors, while six-digit HEX values are more common when precise color selection is required.
Modern CSS also supports eight-digit HEX notation for colors that include an alpha channel.
#RRGGBBAA
The first six digits represent red, green, and blue. The final two hexadecimal characters represent alpha or transparency.
For example:
#3366CC80
Here, #3366CC represents the RGB color while 80 represents the alpha component.
If you only need the RGB color channels, the first six characters can be converted normally. If transparency is important, use a color workflow that preserves the alpha value as well.
HEX is convenient for writing colors, while RGB can be more useful when working with JavaScript, graphics APIs, color manipulation, dynamic interfaces, and applications that need individual color channels.
Convert HEX values into RGB notation for web stylesheets.
Extract individual red, green, and blue values for scripts and interactive color tools.
Analyze and reuse interface colors across buttons, backgrounds, icons, borders, and components.
Move colors between different digital design workflows and applications.
Convert brand HEX colors into RGB values for digital asset production.
Use RGB channels when working with image pixels and graphics processing systems.
Inspect the individual components that make up a digital color.
Maintain consistent color tokens across web applications and component libraries.
RGB colors can be written in CSS using the traditional rgb() function. Modern CSS also supports additional syntax and color functions.
A basic RGB declaration looks like this:
color: rgb(51, 102, 204);
The same color can be represented as a HEX value:
color: #3366CC;
These values describe the same RGB color when interpreted in the same color space and with the same alpha conditions.
CSS also supports modern color functionality. For technical details, see the MDN CSS color documentation.
RGB colors are created by combining three channels. Each channel controls the intensity of one primary component of the digital color.
Increasing one channel changes the resulting color. For example, RGB(255, 0, 0) represents red, RGB(0, 255, 0) represents green, and RGB(0, 0, 255) represents blue in the standard RGB representation.
When all channels have the same value, the result is a neutral gray ranging from black at RGB(0, 0, 0) to white at RGB(255, 255, 255).
Both formats can represent the same underlying RGB color. The best format depends on the tool, application, or development workflow.
UI designers frequently work with HEX values supplied by design systems, brand guidelines, and design applications. Developers may need the same colors in RGB format when implementing interactive components.
RGB values are particularly useful when individual channels need to be manipulated programmatically. This can be useful for dynamic themes, animations, image effects, color generators, and custom interface components.
A designer might provide:
#4F46E5
A developer can convert it into:
rgb(79, 70, 229)
The RGB representation can then be used in a JavaScript or CSS workflow where individual channel values are needed.
A professional design system often stores colors in more than one format. HEX may be convenient for documentation and CSS, while RGB can be useful for programming and color manipulation.
Keeping equivalent values documented can help designers and developers maintain consistency across websites, mobile applications, dashboards, marketing assets, and digital products.
However, it is important to avoid manually entering values from memory. A reliable converter reduces transcription mistakes when moving colors between formats.
You can also use our Color Picker, Color Name Finder, and Color Harmony Finder to continue your color workflow.
HEX and RGB are only two of many color representations used in modern design and development. Depending on the task, you may also need HSL, HSV, LAB, LCH, OKLab, or OKLCH.
HEX to RGB conversion is mathematically straightforward because each two-character hexadecimal pair directly corresponds to an RGB channel value in the standard 8-bit representation.
For a six-digit HEX color, there is no estimation involved in the basic conversion. The hexadecimal channel values are simply interpreted as decimal numbers.
For example, the hexadecimal value FF is decimal 255, while 00 is decimal 0.
The displayed color on a physical screen can still vary because displays, color profiles, brightness, viewing conditions, and rendering environments can affect how colors appear.
Developers often need to extract RGB channels from a HEX color when building image editors, color pickers, canvas applications, chart generators, gradients, visualization tools, and other interactive interfaces.
A HEX value can be divided into its three channel pairs and each pair converted from hexadecimal to decimal.
HEX: #3366CC
RR = 33
GG = 66
BB = CC
RGB = 51, 102, 204
Once these values are available, JavaScript can use them for dynamic CSS, canvas operations, image processing, or other application logic.
Converting a color from HEX to RGB does not itself determine whether the color combination is accessible. Accessibility depends on how colors are used together, particularly for text and backgrounds.
After obtaining RGB values, you can use the colors with an appropriate contrast calculation or accessibility workflow.
Use our Color Contrast Checker for traditional contrast analysis and our APCA Contrast Checker for APCA-based analysis.
For professional accessibility work, also consult the W3C Web Accessibility Guidelines.
Enter a valid HEX color such as #FF0000, #3366CC, #4F46E5, or another supported hexadecimal value.
Make sure the HEX code contains valid hexadecimal characters and follows the required format.
Run the converter to calculate the red, green, and blue channel values.
Copy the RGB values and use them in CSS, JavaScript, design software, or your preferred digital color workflow.
#000000 → RGB(0, 0, 0)
#FFFFFF → RGB(255, 255, 255)
#FF0000 → RGB(255, 0, 0)
#00FF00 → RGB(0, 255, 0)
#0000FF → RGB(0, 0, 255)
#FFFF00 → RGB(255, 255, 0)
A HEX to RGB Converter changes a hexadecimal color code into red, green, and blue channel values.
Separate the HEX color into its red, green, and blue hexadecimal pairs, then convert each pair from hexadecimal to decimal.
The HEX color #FFFFFF converts to RGB(255, 255, 255), which represents white in the standard RGB model.
The HEX color #000000 converts to RGB(0, 0, 0), which represents black in the standard RGB model.
The HEX color #FF0000 converts to RGB(255, 0, 0), representing red in the standard RGB model.
HEX represents RGB channel values using hexadecimal notation, while RGB represents the same type of color using red, green, and blue numerical channel values.
In the common 8-bit RGB representation, red, green, and blue channels each range from 0 to 255.
Yes. A three-digit HEX value can be expanded into a six-digit HEX value before converting it into RGB.
Yes. The first six hexadecimal characters represent the RGB channels. The final two characters represent alpha or transparency.
Yes. RGB colors can be written in CSS using the rgb() function, such as rgb(51, 102, 204).
Standard HEX to RGB conversion is exact for the channel values because each hexadecimal pair directly represents an 8-bit decimal channel value.
RGB values are useful when working with CSS, JavaScript, image processing, graphics, dynamic color manipulation, and applications that need individual red, green, and blue channels.
Convert hexadecimal colors into RGB values for web development, UI design, CSS, JavaScript, graphics, branding, and digital color workflows.