Free HEX to RGB / RGB to HEX Converter
The HEX ↔ RGB Converter translates color values between hexadecimal and RGB formats in real time. Pick a color or type a value and see both formats update instantly.
Colour work continues with the HSL to HEX / RGB Converter and the Color Harmony Generator, while the accessibility check belongs to the Color Contrast Checker. For print rather than screen, the RGB to CMYK Converter is the tool.
How to use the HEX ↔ RGB
- 1 Type or paste a colour in any common format — #2563eb, rgb(37 99 235), or hsl(221 83% 53%).
- 2 The other formats appear immediately, all kept in sync with your input.
- 3 Use the swatch to check the colour at a glance, and the contrast readout to see how it behaves against white and black text.
- 4 Copy whichever format you need for CSS, a design tool or a config file.
Why hex exists at all
Hex is a direct serialisation of the RGB byte values. Each pair of hexadecimal digits represents one channel from 00 to FF, which is 0 to 255 in decimal — exactly the range a single byte can hold. The notation is terse because it is a literal transcription of three bytes rather than a description of a colour.
That is why converting is arithmetic rather than interpretation. There is no colour space transform involved and no approximation: any hex value has exactly one RGB equivalent and the reverse is equally exact. The approximation only enters when you convert to a device-dependent model such as CMYK.
- `#FFFFFF` is `rgb(255, 255, 255)`, pure white.
- `#000000` is `rgb(0, 0, 0)`, pure black.
- `#808080` is `rgb(128, 128, 128)`, mid grey.
- `#FF000080` adds 50% alpha to pure red.
Frequently asked questions
What is the difference between 3-digit and 6-digit hex?
Shorthand #abc expands to #aabbcc — each digit is doubled. It only works when both digits of every channel are identical, so #2563eb has no 3-digit form. Six digits always works.
Can I convert a colour with transparency?
Yes. An 8-digit hex value adds an alpha channel at the end, so #2563eb80 is the blue at 50% opacity. In CSS you can also write rgb(37 99 235 / 0.5), which is easier to read and edit.
Why does the same hex look different on two monitors?
Screens differ in colour gamut, brightness and calibration, and operating systems apply different colour profiles. A hex value is a precise instruction, but the displayed result depends on the hardware and the profile in use.
Related Image & Color Tools
You might also need
Tools from other categories that people pair with the HEX ↔ RGB: