
Converting HEX to RGB is straightforward math once you see the pattern. A HEX code like #3DAF73 splits into three pairs: 3D, AF, and 73. Each pair is a hexadecimal number that converts to a decimal value representing one color channel.

The Manual Method
Each hex digit has a decimal equivalent: 0-9 stay the same, A equals 10, B equals 11, C is 12, D is 13, E is 14, F is 15. To convert a pair, multiply the first digit by 16 and add the second digit. For 3D: 3 times 16 plus 13 equals 61. That is the red value. AF: 10 times 16 plus 15 equals 175. That is green. 73: 7 times 16 plus 3 equals 115. That is blue. So #3DAF73 becomes rgb(61, 175, 115) — a pleasant green.
You can verify this logic with simple cases. FF in hex: 15 times 16 plus 15 equals 255 — the maximum channel value. 00 in hex: 0 times 16 plus 0 equals 0 — the minimum. 80 in hex: 8 times 16 plus 0 equals 128 — exactly the midpoint. These anchors help you sanity-check conversions.

The Practical Method
For quick conversions without math, every modern browser has a built-in converter. Open developer tools, type a hex value into any CSS color property, and the computed panel shows the RGB equivalent. Online tools display both formats simultaneously. JavaScript can convert programmatically using parseInt('3D', 16) to get decimal values from hex pairs — useful when building dynamic color manipulation features.
Our color picker on this site shows HEX, RGB, and HSL simultaneously for any color you select, eliminating the conversion step entirely. Upload an image, click a pixel, and all three formats appear ready to copy.
Reading HEX Intuitively
Understanding the conversion helps you estimate colors without tools. If the first pair is high (FF, E0, C0), the color has strong red. A high middle pair means strong green. A high last pair means strong blue. Equal values across all three pairs — like #7A7A7A — always produce gray. Low overall values trend dark. High overall values trend light. A code like #0A4F8C tells you: almost no red, moderate green, strong blue — expect a deep teal or navy.
This mental model saves time during code review and debugging. Rather than pasting every hex code into a converter, you can glance at the characters and know approximately what color they represent. It is not perfect for subtle shades but catches obvious mismatches instantly — if someone claims a color is red but the hex starts with 00, you know something is wrong.