Hexadecimal number is a number expressed in the base 16 numeral system. Hexadecimal number's digits have 16 symbols: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. Each digit of a hexadecimal number counts a power of 16.
Hexadecimal number example:
62C16 = 6×162+2×161+12×160 = 158010
Decimal number is a number expressed in the base 10 numeral system. Decimal number's digits have 10 symbols: 0,1,2,3,4,5,6,7,8,9. Each digit of a decimal number counts a power of 10.
Decimal number example:
65310 = 6×102+5×101+3×100
A regular decimal number is the sum of the digits multiplied with power of 10.
137 in base 10 is equal to each digit multiplied with its corresponding power of 10:
13710 = 1×102+3×101+7×100 = 100+30+7
Hex numbers are read the same way, but each digit counts power of 16 instead of power of 10.
For hex number with n digits: dn-1 ... d3 d2 d1 d0
Multiply each digit of the hex number with its corresponding power of 16 and sum:
decimal = dn-1×16n-1 + ... + d3×163 + d2×162 + d1×161+d0×160
3B in base 16 is equal to each digit multiplied with its corresponding 16n:
3B16 = 3×161+11×160 = 48+11 = 5910
E7A9 in base 16 is equal to each digit multiplied with its corresponding 16n:
E7A916 = 14×163+7×162+10×161+9×160 = 57344+1792+160+9 = 5930510
0.8 in base 16:
0.816 = 0×160+8×16-1 = 0+0.5 = 0.510
| Hex (base 16) | Decimal (base 10) | Calculation |
|---|---|---|
| 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 | 1×161+0×160 = 16 |
| 20 | 32 | 2×161+0×160 = 32 |
| 30 | 48 | 3×161+0×160 = 48 |
| 40 | 64 | 4×161+0×160 = 64 |
| 50 | 80 | 5×161+0×160 = 80 |
| 100 | 256 | 1×162+0×161+0×160 = 256 |
| FF | 255 | 15×161+15×160 = 255 |
| FFFF | 65535 | 15×163+15×162+15×161+15×160 = 65535 |