As I’ve been talking and writing about IPv6 lately, I recently had someone ask me about the “letters” in an IPv6 address. I realized that if you don’t come out of the realm of computer programming (or mathematics) the whole concept of “hexadecimal” numbering would be quite foreign.
So here’s the deal… the numbering system we normally use is the “decimal” system and is also called “base 10″. There are 10 possible digits that we use when we are counting: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. We combine all those digits together to make the numbers that we use for everything we do.
Presumably we all got started with counting in base 10 because that’s how many fingers we (normally) have.
Computers, on the other hand, don’t have 10 fingers… and they ultimately do their counting in “binary” notation, a.k.a. “base 2″. In binary, there are exactly two digits: 0 and 1.
As people started programming computers, representing numbers in binary was cumbersome… and decimal numbers didn’t really line up with the way computer chips actually work down on a bit level. So people started using other numbering systems based on powers of 2. Some systems used “octal” notation, which is “base 8″ and uses the digits 0, 1, 2, 3, 4, 5, 6, 7.
And other systems use “hexadecimal” notation, a.k.a. “base 16″. The challenge with going above 10, of course, is that we don’t have digit symbols to represent anything above 9. So people started using the letters A, B, C, D, E and F (in either upper or lowercase) to fill out the range of possible values. So 10 in decimal is “a” in hexadecimal, 11 is “b”, etc.
So that’s what is going on… IPv6 addresses use hexadecimal values instead of decimal values. Here’s a quick table to show you what the values are in the various systems:
| 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 |
| 16 |
10 |
20 |
10000 |
| 17 |
11 |
21 |
10001 |
| 18 |
12 |
22 |
10010 |
| 29 |
13 |
23 |
10011 |
| 20 |
14 |
24 |
10100 |
| 21 |
15 |
25 |
10101 |
| 22 |
16 |
26 |
10110 |
| 23 |
17 |
27 |
10111 |
| 24 |
18 |
30 |
11000 |
| 25 |
19 |
31 |
11001 |
| 26 |
1a |
32 |
11010 |
| 27 |
1b |
33 |
11011 |
| 28 |
1c |
34 |
11100 |
| 29 |
1d |
35 |
11101 |
| 30 |
1e |
36 |
11110 |
| 31 |
1f |
37 |
11111 |
| 32 |
20 |
40 |
100000 |
| 33 |
21 |
41 |
100001 |
You can see the pattern… and that’s how hexadecimal notation works!
P.S. If you’re really interested in learning even more about hexadecimal notation, there’s a rather detailed entry at Wikipedia that will give you more than you probably really care to know.