HEX ↔ RGB Converter

Convert colors between HEX and RGB formats. Enter a HEX color or RGB values to get the corresponding color code instantly.

HEX to RGB

Convert a HEX color into RGB values.

RGB to HEX

Convert RGB values into a HEX color.

About HEX ↔ RGB Converter

Convert colors between HEX and RGB formats in both directions. Enter a 3-digit or 6-digit HEX color, or provide individual Red, Green and Blue values to get the equivalent color code. Preview the converted color and copy the result for use in CSS and web projects.

How to Use the HEX ↔ RGB Converter

To convert HEX to RGB, enter a color code such as #2563EB and click Convert to RGB. The tool displays the corresponding Red, Green and Blue values along with a color preview. To convert RGB to HEX, enter a whole number between 0 and 255 in each channel and click Convert to HEX. Use the Copy button to copy the result.

What Is a HEX Color?

HEX is a hexadecimal color notation commonly used in HTML and CSS. A six-digit HEX color contains three pairs of hexadecimal digits: the first pair represents Red, the second Green, and the third Blue. Each pair ranges from 00 to FF, representing decimal values from 0 to 255.

This converter also accepts the shorthand three-digit format. For example, #F0A is expanded to #FF00AA before conversion.

What Is RGB?

RGB stands for Red, Green and Blue. It represents a color using three separate numeric channels. Each channel accepts a whole number from 0 to 255. Combining different channel values produces different colors.

HEX vs RGB

HEX and RGB represent colors using the same three channels: Red, Green and Blue. They differ in how those values are written. HEX uses hexadecimal pairs, while RGB uses decimal numbers. Both formats can be used to specify colors in CSS.

HEX and RGB Conversion Examples

The following examples show how the two formats represent the same colors:

HEX: #2563EB

RGB: rgb(37, 99, 235)

HEX: #FFFFFF

RGB: rgb(255, 255, 255)

HEX: #000000

RGB: rgb(0, 0, 0)

Supported Color Formats and Limitations

The HEX to RGB converter accepts 3-digit and 6-digit hexadecimal color codes, with or without a leading #. The RGB to HEX converter accepts three whole-number values, each between 0 and 255.

This tool converts standard HEX and RGB colors. It does not accept alpha-channel HEX values, RGBA values, HSL values or named CSS colors.

Why Use a HEX to RGB Converter?

Different design tools, code examples and CSS projects may use different color notations. Converting between HEX and RGB makes it easier to reuse an existing color value without manually calculating each channel. This is useful when working with website styles, interface components, design systems and frontend development.

Your privacy matters

We use optional analytics cookies to understand how our tools are used and improve your experience. These controls apply to Google Analytics only, not advertising preferences. Privacy Policy