| DECIMAL
(base 10) |
BINARY
(base 2) |
OCTAL
(base 8) |
HEXADECIMAL
(base 16) |
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 17 | 10001 | 21 | 11 |
| 18 | 10010 | 22 | 12 |
| 19 | 10011 | 23 | 13 |
| 20 | 10100 | 24 | 14 |
| 21 | 10101 | 25 | 15 |
| 22 | 10110 | 26 | 16 |
| 23 | 10111 | 27 | 17 |
| 24 | 11000 | 30 | 18 |
| 25 | 11001 | 31 | 19 |
| 26 | 11010 | 32 | 1A |
| 27 | 11011 | 33 | 1B |
| 28 | 11100 | 34 | 1C |
| 29 | 11101 | 35 | 1D |
| 30 | 11110 | 36 | 1E |
| 31 | 11111 | 37 | 1F |
| 32 | 100000 | 40 | 20 |
| 33 | 100001 | 41 | 21 |
However, it is worth noticing that decimal, binary, octal and hex have different bases.
The bases tell you how many digits each have to represent the numbers. For example
has decimal 10 numbers (from 010 through 910) while octal only has
8 (from 08 through 78).
(The subscript indicates the number's base.
In everyday language we assume that the number is given to us is in decimal/base 10.
We would be rather surprised if the cashier at the local grocery store gave us the price in octal...)
When decimal has counted up to 910, it has run out of available digits and must increase to two digits, from 910 to 1010, setting the lowest based digit to 0. Also, when counted up to 1910 decimal must use the next available digit after 1 (here 2) in its 10-column, again setting the lowest based digit to 0.
Same principal applies to octal. When octal has counted up to 78 (and hence used the available 8 digits), two digits are needed, going from 78 to 108 and setting the lowest based digit to 0. When octal has counted up to 178, the first digit is flipped to the next available digit (here 2) and the lowest based digit is set to 0.Where one digit is added to the number, the number is given in bold in the table above.