Hex to RGB Color Converter

BUSINESS FREE

Free hex to RGB color converter. Convert between #RRGGBB hex codes and RGB values with a live color swatch. No signup.

What the converter does

It translates between the two colour notations used on the web: hex, the #RRGGBB code you paste into CSS, and RGB, the red, green, and blue channel values from 0 to 255. It works in both directions and previews the result as a colour swatch, so you can confirm you have the shade you meant rather than a nearly-right one.

How the conversion works

  • Hex → RGB: the six digits are split into three pairs, one per channel. Each pair is read as base 16, where FF is 255 and 00 is 0.
  • Shorthand: a three-digit code like #F80 expands each digit to a pair, giving #FF8800.
  • RGB → hex: each channel is clamped to 0–255, then written as two hexadecimal digits.
  • The channel values are also written back into the inputs, so you can nudge one and immediately see the hex update.

A worked example

The default value #FF8800 breaks down channel by channel:

PairChannelBase-16 valueDecimal
FFRed15 × 16 + 15255
88Green8 × 16 + 8136
00Blue0 × 16 + 00

So #FF8800 is rgb(255, 136, 0) — full red, a little over half green, no blue, which is a bright orange. Run it the other way and rgb(255, 136, 0) returns #FF8800.

Hex digit reference

HexDecimalHexDecimal
0080128
1F31C0192
4064FF255

Common mistakes

  • Missing the #. The tool accepts a code with or without it, and adds it to the output, but many design tools require it.
  • Using the wrong digit count. Six digits are standard; three are valid shorthand; four or five are invalid and the tool will say so.
  • Assuming hex is always uppercase. Case does not change the colour, but keeping one convention makes stylesheets easier to scan.
  • Expecting alpha from #RRGGBB. Standard hex has no transparency channel. The eight-digit #RRGGBBAA form exists but is a separate notation, and this converter handles the six-digit code.
  • Rounding channels out of range. RGB values are clamped to 0–255, so 300 quietly becomes 255 rather than producing an error.

Common web colours

ColourHexRGB
White#FFFFFFrgb(255, 255, 255)
Black#000000rgb(0, 0, 0)
Red#FF0000rgb(255, 0, 0)
Green#008000rgb(0, 128, 0)
Blue#0000FFrgb(0, 0, 255)
Mid grey#808080rgb(128, 128, 128)

Equal values in all three channels always produce a grey — the closer to 255, the lighter. That makes #RRGGBB a quick way to reason about a colour: read the pairs as red, green, and blue intensity in order.

Frequently asked questions

Why does the same colour have two notations?

Hex is compact and human-readable in code, while RGB maps directly to how screens mix light. They describe the same colour, and one converts to the other exactly.

What does a three-digit hex code mean?

It is shorthand where each digit is doubled. #FFF is #FFFFFF (white), and #F80 is #FF8800. It only works when both digits of a pair are identical.

How do I know a colour is accessible?

The converter gives you exact values, which you can then test for contrast against your text. Light shades need dark text and vice versa; a contrast checker measures the ratio that WCAG guidelines require.

Can it convert to other colour models like HSL?

Not here. Hex and RGB share the same underlying channels, which makes the conversion exact; other models involve a different way of describing hue and saturation. The number base converter is handy if you want to see how the hexadecimal pairs map to decimal, and the unit converter covers the measurement side of design work.