From a color code to numbers you can use
Your stylesheet says #E2725B, a warm terracotta, but the design tool you are pasting into wants three separate red, green, and blue numbers. Or a debugger shows a memory address like 0x2F and you want its plain decimal value. Hexadecimal pops up constantly in computing, and this converter translates it into decimal, RGB triplets, and binary so you can work with the value wherever you need it.
The idea behind the conversion
Formula: hex value = h_n x 16^n + ... + h_1 x 16^1 + h_0 x 16^0, where each digit h is 0-9 or A-F (A=10, B=11, C=12, D=13, E=14, F=15).
Hexadecimal is base 16, which means each position is worth sixteen times the one to its right. Take the pair E2: E stands for 14, so the value is 14 x 16 + 2 = 224 + 2 = 226. That grouping is why hex is so popular in computing: one hex digit maps neatly onto exactly four bits, so long binary strings collapse into short, readable codes. The tool expands or compresses between hex, decimal, and binary using exactly this place-value arithmetic.
How to use it
- Paste or type your hexadecimal value. The # sign and 0x prefix are optional.
- Choose what you want out: decimal, RGB values, or binary.
- Copy the result straight into your code, stylesheet, or notes.
- Flip it around any time to convert decimal back into hex.
Worked example: #E2725B to RGB
Split the code into three pairs: E2, 72, and 5B. Convert each pair with the formula. Red: E2 = 14 x 16 + 2 = 224 + 2 = 226. Green: 72 = 7 x 16 + 2 = 112 + 2 = 114. Blue: 5B = 5 x 16 + 11 = 80 + 11 = 91. So #E2725B is rgb(226, 114, 91). You can sanity-check the math another way: E2 in binary is 11100010, which is 128 + 64 + 32 + 2 = 226, matching the place-value result exactly. Cross-checking between bases like this catches slip-ups.
Where this comes up in real life
Frontend developers convert hex colors to RGB when a tool demands that format. Network engineers read MAC addresses, which are written in hex pairs. When a program crashes, the error log often prints memory addresses in hex, and converting a small one to decimal helps you compare offsets. Arduino and embedded hobbyists constantly move between hex register values and the decimal numbers they mean.
Mistakes to avoid
- Counting the # or 0x as part of the number. Those are just markers that say hex follows; the value itself starts after them.
- Expanding 3-digit shorthand wrong. The short form ABC means AABBCC, with each digit doubled, not ABC padded with zeros.
- Assuming case matters. #e2725b and #E2725B are identical. Mixing cases inside one code is fine, though consistency reads better.
Good to know
Only the characters 0-9 and A-F are valid in hexadecimal, so the tool will reject anything else rather than guess. Conversions are exact for normal-length values. For related jobs, the decimal converter goes the other way from ordinary numbers into hex, the binary converter works directly with bit strings, and the text to binary converter shows how whole characters become binary codes.