How it works
Hexadecimal counts in base 16, decimal counts in base 10. Converting means rewriting the same quantity with a different set of digits — the value never changes, only how it is written.
- Number the digits from the right, starting at 0.
- Multiply each digit by 16 raised to the power of its position.
- Add the results — that total is the decimal value.
The reverse conversion is Decimal to Hexadecimal, which also handles every other base pair.
Examples
Worked examples, digit by digit:
- 10 (hexadecimal) = 1×161 + 0×160 = 16 (decimal)
- 21 (hexadecimal) = 2×161 + 1×160 = 33 (decimal)
- FF (hexadecimal) = 15×161 + 15×160 = 255 (decimal)
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
Hexadecimal to Decimal: frequently asked questions
- How do I convert hexadecimal to decimal?
- Multiply each hexadecimal digit by 16 raised to its position (starting at 0 on the right) and add the results. For example, 2D = 2×16^1 + 13×16^0 = 45. The converter above does this instantly for any value.
- What is FF in decimal?
- Hexadecimal FF equals 255 in decimal (the value 255, the largest number that fits in one byte).
- Why are hexadecimal and decimal used?
- Hexadecimal (base 16, digits 0–9 and A–F) writes each byte as exactly two characters, which is why it is used for colours (#FF8800), memory addresses and MAC addresses. Decimal (base 10) is the everyday number system.
