CalcaTools

Hex to RGB Converter

A free tool for developers and designers to convert Hexadecimal color codes to RGB/RGBA formats instantly. Features a live color preview and click-to-copy values.

Last updated: June 2026 · Free · No sign-up required

#
1.00
CSS RGB
rgb(0, 0, 0)
CSS RGBA
rgba(0, 0, 0, 1)

Quick reference

HEXRGB
#FFFFFF255, 255, 255
#0000000, 0, 0
#3B82F659, 130, 246
#22C55E34, 197, 94
#7F00FF127, 0, 255

Interpretation guide

Hex digitDecimal
0–90–9
A10
B / C / D11 / 12 / 13
E / F14 / 15

Formula & methodology

Formula: Channel = first hex digit x 16 + second hex digit; e.g. B2 = 11 x 16 + 2 = 178

How HEX converts to RGB

A HEX color is three base-16 pairs — red, green, blue. Convert each pair to a 0-255 decimal: multiply the first digit by 16 and add the second.

Example: #3B82F6

  • Red 3B = 3 x 16 + 11 = 59
  • Green 82 = 8 x 16 + 2 = 130
  • Blue F6 = 15 x 16 + 6 = 246

So #3B82F6 = rgb(59, 130, 246). To reverse it, convert each 0-255 value to two hex digits (e.g. 130 → 82) and concatenate with a leading #.

Frequently asked questions

How do you convert HEX to RGB?
Split the hex code into three pairs (red, green, blue) and convert each pair from base 16 to decimal: multiply the first digit by 16 and add the second. For #3B82F6, red 3B = 59, green 82 = 130, blue F6 = 246, giving rgb(59, 130, 246).
What is #FFFFFF in RGB?
#FFFFFF is white, or rgb(255, 255, 255). Each FF pair equals 15 x 16 + 15 = 255, the maximum for every channel, so full red, green, and blue light combine to make white. At the opposite end, #000000 is rgb(0, 0, 0), black.
How do I convert a 3-digit HEX code?
A shorthand 3-digit hex like #F0A expands by doubling each digit: #F0A becomes #FF00AA. Then convert normally: FF = 255, 00 = 0, AA = 170, giving rgb(255, 0, 170). The short form only works when each channel's two digits are identical.
How do you convert RGB back to HEX?
Convert each 0-255 value to a two-digit hex number and join them with a leading #. Divide the value by 16 for the first digit and take the remainder for the second (using A-F for 10-15). For rgb(34, 197, 94): 34 = 22, 197 = C5, 94 = 5E, so the hex is #22C55E.
Why are there letters in HEX color codes?
HEX codes are base 16, which needs sixteen single-character digits. After 0-9, the letters A through F stand for the values 10 through 15. This lets each color channel (0-255) fit in exactly two characters, keeping codes compact — FF for 255, for instance, instead of a longer decimal.

Explore the full unit converter toolkit

Every CalcaTools converter — length, volume, weight, time and date, number notation, science and energy, plus file, text and colour utilities — each with instant results and worked explanations.