HEX and RGB Color Converter

This tool translates a six-digit hexadecimal sRGB color into three decimal RGB channels that can be used in CSS and design documentation.

Last updated: November 27, 2026  •  Published by: NOFYI Editorial Team  •  Category: Image Tools

Workspace

What Is the HEX to RGB Converter?

The HEX to RGB Converter translates a color between HEX notation and RGB notation. HEX writes a color as a hash followed by six hexadecimal digits, such as #FF5733. RGB writes the same color as three decimal numbers from 0 to 255, such as rgb(255, 87, 51). Each pair of HEX digits corresponds to one RGB channel: the first pair is red, the second is green, and the third is blue. Converting does not change the color; it only changes how the color is written, so designers and developers can move a value between tools that expect different formats.

HEX is the usual format in CSS and design tools. RGB is used when a tool asks for separate red, green, and blue channels, or when you need to adjust one channel, set opacity with rgba(), or perform arithmetic on a channel.

How to Use the HEX to RGB Converter

  1. Paste or type a HEX color, such as #FF5733, into the HEX field, or enter RGB values from 0 to 255 into the red, green, and blue fields.
  2. The converter updates the other format automatically.
  3. Copy the converted value and paste it into your stylesheet, design file, or code.
  4. If you need a semi-transparent version, take the RGB values and use them in rgba() form, for example rgba(255, 87, 51, 0.5) for 50% opacity.
  5. Check the preview swatch. If it does not look like the color you expected, recheck that you entered the digits in red, green, blue order.

Worked Example

Convert #FF5733 to RGB. Split the six digits into three pairs: FF, 57, and 33. Each pair is a hexadecimal number. FF in hexadecimal equals 15 × 16 + 15 = 255. 57 equals 5 × 16 + 7 = 87. 33 equals 3 × 16 + 3 = 51. So #FF5733 is rgb(255, 87, 51).

Going the other way, rgb(0, 128, 255) converts to #0080FF: 0 becomes 00, 128 becomes 80, and 255 becomes FF. Shorthand HEX also works: #F53 expands to #FF5533, which is rgb(255, 85, 51), because each single digit is doubled.

Limitations

  • HEX and RGB describe screen colors only. They do not describe print ink colors, so a screen color matched for print may still shift.
  • A HEX value with characters outside 0-9 and A-F, or with the wrong number of digits, is not a valid color and cannot be converted.
  • RGB values must be whole numbers from 0 to 255. Decimal values or numbers outside that range are invalid.
  • The same numeric color can look slightly different on different screens because of display calibration and color profile.
  • The converter changes notation, not appearance. It cannot fix a color that is too light, too dark, or low in contrast against its background.

Frequently Asked Questions

Do I need the # in front of a HEX color?

In CSS, yes: write #FF5733. This converter accepts the value with or without the hash, but include it when you paste the value into a stylesheet.

What is shorthand HEX?

Shorthand HEX uses three digits instead of six, such as #F53. Each digit is doubled to get the full value: #FF5533. It only works when each channel’s two digits are identical.

How do I add transparency to a HEX color?

Use the RGB values in rgba() form, such as rgba(255, 87, 51, 0.5), where the fourth number is opacity from 0 (fully transparent) to 1 (fully opaque). Eight-digit HEX with an alpha pair, such as #FF573380, is also supported in modern browsers, but rgba() is more widely understood.

Why does rgb(255, 87, 51) not match the color I sampled?

Sampling a screenshot can pick up a blended edge pixel, an overlay, or a compression artifact instead of the intended flat color. Sample the center of a flat area, or read the computed color from your browser’s developer tools.