Menu

HEX → RGB Converter

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

Preserve alpha channel when present
Auto-copy on change

Accepts #RGB, #RGBA, #RRGGBB, #RRGGBBAA, with or without the leading #. Whitespace is ignored.

Channel preview

R
0
G
0
B
0

Quick presets

Harmonies

Click a swatch to load it into the converter.


        

Live preview

#7C3AED
Acme UI

Preview surface

Text on white, muted text, and a button using your color as its background.

Subtle background derived from your color.

Channel values

Contrast checks (WCAG 2, 4.5:1)

✓ Copied!
COLOR CONVERSION TOOL

HEX to RGB Converter

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 → RGB CSS Ready RGB Values Free Online Tool
HEX

HEX Color Codes

HEX is a compact hexadecimal notation commonly used to represent RGB colors in websites, applications, design systems, and digital graphics.

RGB

RGB Color Values

RGB describes a color using red, green, and blue channels. Each standard 8-bit channel normally ranges from 0 to 255.

CSS

Web Development

RGB values can be used in CSS, graphics software, JavaScript interfaces, design systems, and many other digital color workflows.

OVERVIEW

What Is a HEX to RGB Converter?

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.

QUICK EXPLANATION

HEX Stores RGB Channels in Hexadecimal Form

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.

HEX BASICS

What Is a HEX Color Code?

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.

# Color prefix
RR Red channel
GG Green channel
BB Blue channel

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 BASICS

What Is RGB?

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.

R

Red

Controls the red component of the color from 0 to 255.

G

Green

Controls the green component of the color from 0 to 255.

B

Blue

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.

CONVERSION

How Does HEX to RGB Conversion Work?

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.

01

Read the HEX Code

Start with a valid six-digit HEX value such as #3366CC.

02

Separate Channels

Divide the code into three pairs: 33, 66, and CC.

03

Convert to Decimal

Convert each hexadecimal pair into its decimal equivalent.

04

Build RGB

Combine the three decimal values as RGB(red, green, blue).

EXAMPLE

Convert #3366CC to RGB

HEX #3366CC
RED 33 → 51
GREEN 66 → 102
BLUE CC → 204
RGB(51, 102, 204)
FORMULA

HEX to RGB Conversion Formula

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.

SHORT HEX

What Is 3-Digit HEX to RGB?

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.

HEX WITH ALPHA

What About 8-Digit HEX Colors?

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.

WEB DEVELOPMENT

Why Convert HEX to RGB?

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.

USE CASES

Common Uses for a HEX to RGB Converter

CSS Development

Convert HEX values into RGB notation for web stylesheets.

JavaScript

Extract individual red, green, and blue values for scripts and interactive color tools.

UI Design

Analyze and reuse interface colors across buttons, backgrounds, icons, borders, and components.

Graphic Design

Move colors between different digital design workflows and applications.

Brand Colors

Convert brand HEX colors into RGB values for digital asset production.

Image Processing

Use RGB channels when working with image pixels and graphics processing systems.

Color Analysis

Inspect the individual components that make up a digital color.

Design Systems

Maintain consistent color tokens across web applications and component libraries.

CSS

Using RGB Colors in CSS

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 CHANNELS

Understanding Red, Green, and Blue Values

RGB colors are created by combining three channels. Each channel controls the intensity of one primary component of the digital color.

Channel Range Meaning
Red 0–255 Red intensity
Green 0–255 Green intensity
Blue 0–255 Blue intensity

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).

HEX VS RGB

HEX vs RGB: What Is the Difference?

HEX

  • Uses hexadecimal notation
  • Usually written as #RRGGBB
  • Compact and easy to copy
  • Common in CSS and design tools
  • Each channel uses two hexadecimal digits

RGB

  • Uses red, green, and blue channels
  • Usually uses values from 0 to 255
  • Easy to manipulate channel by channel
  • Useful in JavaScript and graphics workflows
  • Can be written using the CSS rgb() function

Both formats can represent the same underlying RGB color. The best format depends on the tool, application, or development workflow.

DESIGN WORKFLOW

HEX to RGB for UI and UX Design

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.

DESIGN SYSTEMS

HEX to RGB for Design Systems and Brand Colors

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.

COLOR FORMATS

HEX to RGB and Other Color Conversions

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.

ACCURACY

How Accurate Is HEX to RGB Conversion?

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

HEX to RGB for JavaScript and Programming

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.

ACCESSIBILITY

HEX to RGB and Color Accessibility

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.

HOW TO USE

How to Convert HEX to RGB Online

1

Enter a HEX Color

Enter a valid HEX color such as #FF0000, #3366CC, #4F46E5, or another supported hexadecimal value.

2

Check the Color

Make sure the HEX code contains valid hexadecimal characters and follows the required format.

3

Convert HEX to RGB

Run the converter to calculate the red, green, and blue channel values.

4

Copy the RGB Result

Copy the RGB values and use them in CSS, JavaScript, design software, or your preferred digital color workflow.

COMMON EXAMPLES

Popular HEX to RGB Color Examples

Black #000000 → RGB(0, 0, 0)
White #FFFFFF → RGB(255, 255, 255)
Red #FF0000 → RGB(255, 0, 0)
Green #00FF00 → RGB(0, 255, 0)
Blue #0000FF → RGB(0, 0, 255)
Yellow #FFFF00 → RGB(255, 255, 0)
FAQ

Frequently Asked Questions About HEX to RGB

What is a HEX to RGB Converter?

A HEX to RGB Converter changes a hexadecimal color code into red, green, and blue channel values.

How do I convert HEX to RGB?

Separate the HEX color into its red, green, and blue hexadecimal pairs, then convert each pair from hexadecimal to decimal.

What is the RGB value of #FFFFFF?

The HEX color #FFFFFF converts to RGB(255, 255, 255), which represents white in the standard RGB model.

What is the RGB value of #000000?

The HEX color #000000 converts to RGB(0, 0, 0), which represents black in the standard RGB model.

What is the RGB value of #FF0000?

The HEX color #FF0000 converts to RGB(255, 0, 0), representing red in the standard RGB model.

What is the difference between HEX and RGB?

HEX represents RGB channel values using hexadecimal notation, while RGB represents the same type of color using red, green, and blue numerical channel values.

What is the RGB range for each channel?

In the common 8-bit RGB representation, red, green, and blue channels each range from 0 to 255.

Can I convert 3-digit HEX to RGB?

Yes. A three-digit HEX value can be expanded into a six-digit HEX value before converting it into RGB.

Can 8-digit HEX be converted to RGB?

Yes. The first six hexadecimal characters represent the RGB channels. The final two characters represent alpha or transparency.

Can I use RGB values in CSS?

Yes. RGB colors can be written in CSS using the rgb() function, such as rgb(51, 102, 204).

Is HEX to RGB conversion accurate?

Standard HEX to RGB conversion is exact for the channel values because each hexadecimal pair directly represents an 8-bit decimal channel value.

Why convert HEX to RGB?

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.

FREE COLOR CONVERTER

Convert HEX to RGB Online

Convert hexadecimal colors into RGB values for web development, UI design, CSS, JavaScript, graphics, branding, and digital color workflows.