Numbers are abstract concepts that we represent with digits from a numbering system. Our number systems are positional systems where each position of a digit signifies a value based on the number base.
The base of a number system is arbitrary, except that some bases are more "natural" for some situations. Our most familiar number base is 10 (decimal), probably used because we have 10 fingers (digits).
A computer doesn't have 10 fingers (digits) - it has only two: one and zero, because it uses electronic switches that can either be ON (1) or OFF (0). So it's natural to use the base 2 system with computers. (binary number system)
Since binary is cryptic and difficult to understand as the digits increase, we use hexadecimal (base 16) as a shorthand notation. It simply groups 4 binary digits and expresses them as a single hex digit (0-9, a-f).
The following table shows how you can express a number, in three different bases: base 2, base 10 and base 16.
| unsigned binary (base 2) | hex (base 16) | decimal (base 10) |
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 10 (2^1) | 2 | 2 |
| 11 | 3 | 3 |
| 100 (2^2) | 4 | 4 |
| 101 | 5 | 5 |
| 110 | 6 | 6 |
| 111 | 7 | 7 |
| 1000 (2^3) | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | a | 10 (10^1) |
| 1011 | b | 11 |
| 1100 | c | 12 |
| 1101 | d | 13 |
| 1110 | e | 14 |
| 1111 | f | 15 |
| 10000 (2^4) | 10 (16^1) | 16 |
| . . . | . . . | . . . |
| 11111 | 1f | 31 |
| 100000 (2^5) | 20 | 32 |
| . . . | . . . | . . . |
| 111111 | 3f | 63 |
| 1000000 (2^6) | 40 | 64 |
| . . . | . . . | . . . |
| 1100011 | 63 | 99 |
| 1100100 | 64 | 100 (10^2) |
| . . . | . . . | . . . |
| 1111111 | 7f | 127 |
| 10000000 (2^7) | 80 | 128 |
| . . . | . . . | . . . |
| 11111111 | ff | 255 |
| 100000000 (2^8) | 100 (16^2) | 256 |
| binary | hex | decimal |