HEX to RGB

Convert HEX color codes to RGB values with a live preview.

Type a HEX value or pick a color – the result updates instantly.

​

Preview

HEX to RGB Converter

Paste a HEX color code such as #4682B4 and get the matching RGB value – rgb(70, 130, 180) – instantly, together with a live color preview. You can also click the color picker, pick any shade, and read its RGB value. Below the result you will find the same color in RGBA, HSL, HSV, CMYK, and its closest CSS color name, each with a copy button.

How HEX color codes work

A HEX color is three bytes written in hexadecimal: #RRGGBB. Each pair runs from 00 (0) to FF (255) and sets the intensity of the red, green, and blue light channels. Converting to RGB is just a base change for each pair:

Channel HEX Decimal
Red 46 70
Green 82 130
Blue B4 180

The formula for one channel is first digit × 16 + second digit, where A–F stand for 10–15. For B4: 11 × 16 + 4 = 180.

Accepted input formats

  • Six-digit codes with or without the hash: #FF6347, ff6347.
  • Three-digit shorthand: #F60 → #FF6600.
  • Eight-digit and four-digit codes with alpha: #FF634780, #F608.
  • A 0x prefix, as used in code: 0xFF6347.

When you need RGB instead of HEX

HEX is the most compact way to write a color in CSS and design tools, but many APIs and languages expect separate channel values: canvas drawing, Android Color.rgb(), Python imaging libraries, LED strips, and game engines all work with 0–255 numbers. RGB is also easier to tweak by hand – raising the blue channel by 20 is simpler than doing hex arithmetic. When you need transparency, switch to the HEX to RGBA converter; to go the other way use RGB to HEX.

Privacy

The conversion runs entirely in your browser. Nothing you type is uploaded, so the tool works offline once the page has loaded.

Frequently Asked Questions

Split the six hex digits into three pairs (red, green, blue) and convert each pair from base 16 to decimal. #FF6347 becomes FF = 255, 63 = 99, 47 = 71, so the RGB value is rgb(255, 99, 71).

Yes. Short codes are expanded by doubling each digit, so #F60 is read as #FF6600 and converts to rgb(255, 102, 0). The # sign is optional.

The last two digits are the alpha channel. #FF634780 converts to rgb(255, 99, 71) with an alpha of 0.502; use the HEX to RGBA converter or the RGBA row in the result table to keep the transparency.

Yes. HEX and RGB describe exactly the same 8-bit sRGB values, just in base 16 and base 10, so converting back and forth never changes the color.