- Home
- Tools
- Math
- Number Base Converter
- Hex to Decimal Converter
Hex to Decimal Converter
Turn a hexadecimal number such as 2AF or 0xFF into decimal, with the worth of every digit added up for you.
Type a hexadecimal number in the first field and read it in decimal in the second. It works the other way round as well. Whole numbers only; spaces, underscores and the prefixes 0b, 0o and 0x are fine.
Working
| Digit | Place value | Digit × place value |
|---|---|---|
| 2 | 256 | 2 × 256 = 512 |
| A | 16 | 10 × 16 = 160 |
| F | 1 | 15 × 1 = 15 |
512 + 160 + 15 = 687
Other bases
- Bit length
- 10 bits
- Fits in
- 2 bytes
How to convert hexadecimal to decimal by hand
Hexadecimal has sixteen digits. After 9 come the letters A to F, which stand for 10 to 15.
Each place is worth sixteen times the place to its right: 1, 16, 256, 4096, 65536. Multiply every digit by the worth of its place and add the results. For 2AF that is 2 × 256 + 10 × 16 + 15 × 1, or 512 + 160 + 15 = 687.
The working under the two fields at the top of the page does this for whatever number you type.
Good to know
- Capitals and lower case mean the same: 2af is 2AF. The prefix 0x, as in 0x2AF, only says that the number is hexadecimal and can be left in.
- Two hex digits make one byte, so FF is 255. A colour such as #FF8800 is three such bytes: 255, 136 and 0.
- FFFF is 65535 and FFFFFFFF is 4294967295, the largest values that fit in 16 and in 32 bits.
Hexadecimal to decimal table
| Hexadecimal | Decimal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
| 8 | 8 |
| 9 | 9 |
| A | 10 |
| B | 11 |
| C | 12 |
| D | 13 |
| E | 14 |
| F | 15 |
| 10 | 16 |
| Hexadecimal | Decimal |
|---|---|
| 14 | 20 |
| 20 | 32 |
| 32 | 50 |
| 40 | 64 |
| 64 | 100 |
| 7F | 127 |
| 80 | 128 |
| C8 | 200 |
| FF | 255 |
| 100 | 256 |
| 1F4 | 500 |
| 200 | 512 |
| 3E8 | 1000 |
| 400 | 1024 |
| 1000 | 4096 |
| FFFF | 65535 |
The number base converter shows binary, octal, decimal and hexadecimal next to each other, and explains positional notation and two's complement.