Converting Bases

First of all, you may be thinking, what's a base? Well, it's kind of hard to explain.  To the best of my knowledge, a base is how many digits you use when writing numbers.

When a number x is written in base n, it is written xn.

When we say that a base is how many digits you can use, we mean that if a number is in base 3, then we cannot use the digit 3, or any higher ones (because digits start at 0, not 1, so you can use 0, 1, and 2).  We use base 10, also called the decimal system.

So what digits can we use for base 2 (also called binary: it is what computers are written in)? 0 and 1
For base 4? 0, 1, 2, and 3
For base 6? 0, 1, 2, 3, 4, and 5

What about base 16? Well we obviously don't have 16 digits.  Base 16 is also called hexadecimal.  It uses the digits 0=9, but for the 6 digits it uses that we don't have (10, 11, 12, 13, 14, and 15), it uses the letters A, B, C, D, E, and F, respectively.

First I will show how to convert any base to base 10, and then from base 10 to any base.  So first let's take a number in a base...say 2013.

Now stay with me on this.  First we count each place (digit) in the number from right to left starting at 0.
2 0 1
2 1 0
Then, since it is base 3, we multiply each digit by 3m, where m is the number we just counted for it.
1 * 30 = 1 * 1 = 1
0 * 31 = 0 * 3 = 0
2 * 32 = 2 * 9 = 18

Now we add the products up.
1 + 0 + 18 = 19
So 2013 = 1910.

Try another: 1101012
1 => 0, 0 => 1, 1 => 2, 0 => 3, 1 => 4, 1 => 5
(1*20) + (0 * 21) + (1*22) + (0*23) + (1*24) + (1*25) =
1 + 0 + 4 + 0 + 16 + 32 = 53
1101012 = 5310

If you want to try some more, the answers without explanations (sorry) are on a separate page.
1. 4567
2. 256
3. 1005
4. 1A216
Answers

Click here for the next page of converting bases.
Click here to go back to the index.