Converting hexadecimal to decimal is a skill every programmer and IT student needs. This guide walks through the method step by step with worked examples, plus a shortcut for the most common cases.
The Method: Multiply and Add
Each hex digit represents a power of 16, starting from 16⁰ = 1 on the right. Multiply each digit by its place value, then add everything up.
Place values from right to left: 1, 16, 256, 4096, 65536, … (each is 16× the previous).
Step-by-step with 2F7
Step 1. Write the place values under each digit:
“`
Digit: 2 F 7
Place value: 256 16 1
“`
Step 2. Convert letters to numbers (A=10, B=11, C=12, D=13, E=14, F=15):
“`
2 → 2, F → 15, 7 → 7
“`
Step 3. Multiply and add:
“`
(2 × 256) + (15 × 16) + (7 × 1)
= 512 + 240 + 7
= 759
“`
2F7 in hex = 759 in decimal. ✓
More Worked Examples
Example 1: FF (the classic)
“`
F → 15, F → 15
(15 × 16) + (15 × 1) = 240 + 15 = 255
“`
FF = 255 – the maximum value of one byte. You’ll see this constantly.
Example 2: 1A4
“`
1 → 1, A → 10, 4 → 4
(1 × 256) + (10 × 16) + (4 × 1)
= 256 + 160 + 4 = 420
“`
Example 3: BEEF (yes, really)
Programmers love hex words. BEEF:
“`
B → 11, E → 14, E → 14, F → 15
(11 × 4096) + (14 × 256) + (14 × 16) + (15 × 1)
= 45056 + 3584 + 224 + 15 = 48879
“`
Example 4: 100
“`
1 → 1, 0 → 0, 0 → 0
(1 × 256) + 0 + 0 = 256
“`
Just like decimal 100 means “one hundred,” hex 100 means “one two-fifty-six” – i.e., 16² = 256.
The Shortcut: Hex via Binary
For many people, going through binary is actually easier because each hex digit maps to exactly 4 bits:
- Convert each hex digit to 4-bit binary: `2F7` → `0010 1111 0111`
- Convert that binary to decimal using powers of 2.
This avoids multiplying by 256 and 4096. Our binary converter shows hex, binary, and decimal side by side so you can verify each step.
Common Hex-to-Decimal Values Worth Memorizing
| Hex | Decimal | Why it matters |
|---|---|---|
| 0x0 | 0 | Zero |
| 0xA | 10 | First “letter digit” |
| 0xF | 15 | Max single hex digit |
| 0x10 | 16 | Hex “ten” |
| 0x64 | 100 | Decimal 100 in hex |
| 0xFF | 255 | Max one byte |
| 0x100 | 256 | 16² |
| 0x3E8 | 1000 | Decimal 1000 in hex |
| 0xFFFF | 65535 | Max two bytes (16-bit) |
Hex to Decimal in Programming
Every major language has a built-in way to do this conversion:
Python:
“`python
int(“2F7”, 16) # → 759
int(“FF”, 16) # → 255
“`
JavaScript:
“`javascript
parseInt(“2F7”, 16); // → 759
parseInt(“FF”, 16); // → 255
“`
Manual check with place values: When debugging, it helps to write out the powers of 16 explicitly. For a 4-digit hex number ABCD, the place values are 4096, 256, 16, 1 – so the value is (A×4096) + (B×256) + (C×16) + D. Writing it this way catches the most common mistake, which is misaligning digits with place values.
Spreadsheet: In Excel or Google Sheets, `=HEX2DEC(“2F7”)` gives 759 directly. Note that HEX2DEC only handles up to 10 hex digits (40-bit values).
Understanding the manual method matters even when tools exist: it lets you sanity-check debugger output, estimate values at a glance (any hex starting with 8-F in the leftmost digit of a byte is ≥ 128), and catch endianness bugs where bytes appear in reversed order.
Mistakes to Avoid
- Forgetting A=10, not 1. The most common error. A is ten, B is eleven, through F at fifteen.
- Reading left to right with the wrong place values. The rightmost digit is always ×1, then ×16 moving left. Double-check your alignment.
- Mixing up 0x prefix. `0x10` is hex (16), but plain `10` is decimal (10). The prefix matters.
Frequently Asked Questions
What is hexagon to decimal conversion?
“Hexagon to decimal” is a common misspelling of “hex to decimal” – converting a hexadecimal (base-16) number to decimal (base-10). Multiply each hex digit by its power-of-16 place value and sum the results.
How do you convert FF to decimal?
F = 15, so FF = (15 × 16) + (15 × 1) = 240 + 15 = 255.
What is the fastest way to convert hex to decimal?
For 1-2 digit hex values, memorize common ones (FF=255, 80=128, A=10). For longer values, use the multiply-and-add method above, or paste the value into a binary converter that displays decimal alongside hex.
How do I convert a hex color like #FF5733 to decimal RGB?
Split into three byte pairs: FF, 57, 33. Convert each: FF=255, 57=(5×16)+7=87, 33=(3×16)+3=51. So the RGB is (255, 87, 51).