What is Hexadecimal?
Hexadecimal in a base 16 number system. The digits 0 to 9 are joined by digits "A" to "F" representing the values 10 to 15. All the common arithmetic operations work the same way as in decimal.
Octal is base 8 and only uses the digits 0 to 7. By using the letters A to Z you can create any number base up to 36.
Where are different number bases used?
A byte on a computer can represent a value from 0 to 255, so all possible values of a byte can be represented with 2 hexadecimal digits. Many programming languages have native support for hexadecimal, where the numbers are prefixed by 0x.
| Decimal | Hexadecimal | Octal | Binary |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 2 | 2 | 2 | 10 |
| 3 | 3 | 3 | 11 |
| 4 | 4 | 4 | 100 |
| 5 | 5 | 5 | 101 |
| 6 | 6 | 6 | 110 |
| 7 | 7 | 7 | 111 |
| 8 | 8 | 10 | 1000 |
| 9 | 9 | 11 | 1001 |
| 10 | A | 12 | 1010 |
| 11 | B | 13 | 1011 |
| 12 | C | 14 | 1100 |
| 13 | D | 15 | 1101 |
| 14 | E | 16 | 1110 |
| 15 | F | 17 | 1111 |