Basic information about conversions

We begin with the process of converting an integer between base 10 and base b, where b > 1 is an integer. Information about converting non-integers between bases—and converting to/from non-integer bases—is given in the "Advanced" section below.

First note that when dealing with b > 10, we need more digits. This Web page adopts the typical convention of using letters as digits: A=10, B=11, ..., Z=35 (and, if needed, a=36, b=37, ..., z=61). In addition, note that any numbers on this page with no specified base are in base 10 (decimal). (In a few cases, "base 10" or "decimal" has been attached to those numbers for added clarity.)

Whether converting to or from base 10, it is helpful to first write down powers of the other base—starting with b0=1, and including all those powers which we need for the conversion. For example, if b=5, then we list

50 = 1, 51 = 5, 52 = 25, 53 = 125, ...

It is also good to recall the concept of place value—the idea that in a number, the value of a digit depends on its position. For example, in the base-10 number 1234, the digit "2" is worth 200, because it is in the 102 = hundreds place:

Finally, note that converting to base 10 involves multiplication, while converting from base 10 involves division. (That's why most people find that converting to base 10 is easier—at least when done by hand.)

Basic conversion from base b to base 10 (multiplication)

To convert from base b (an integer) to base 10, we need to think about how the concept of place value applies to other bases. For example, in the base-5 number 1324base 5, the digit "3" is worth 75, because it is in the 52 = 25s place. If we want to convert 1324base 5 to base 10, we use this idea like so:

The process to convert 2B0Abase 14 to base 10 would be:

Make your own example: Convert from base b to base 10
Enter a number in another base:  
Enter starting base:

 

Basic conversion from base 10 to base b (division)

To convert from base 10 to base b, we again write out powers of b. This time, we are interested in how many times each power of b will go into the number being converted (the quotient), and what is left over (the remainder).

For example, suppose we want to convert 581base 10 to base 6. The powers of 6 are 1, 6, 36, 216, 1296, ..., so the highest power we can use is 63=216.

Using long division, we find that 581 ÷ 216 = 2 with a remainder of 149; that is, 581 = 2 × 63 + 149.

Now we need to break up the remaining 149 into groups of 36; we find that 149 ÷ 36 = 4 with a remainder of 5. Then 581 = 2 × 63 + 4 × 62 + 5. Similarly, 5 ÷ 6 = 0 remainder 5—and of course 5 ÷ 1 = 5 remainder 0—so

581base 10 = 2 × 63 + 4 × 62 + 0 × 61 + 5 × 60 = 2405base 6.

This process can be summarized by the following sequence of divisions; the digits of the base-6 number are the quotients on the top line (along with the final remainder):

Similarly, here is the process to show that :

Make your own example: Convert from base 10 to base b
Enter a number in base 10:  
Enter base to convert to:

 

Advanced: Converting non-integers from base b (an integer) to base 10

If the number to be converted from base b has digits after the "point"—note: it is only a decimal point in base 10!—then converting to base 10 is done as with integers, using negative exponents to the right of the point. For example:

Advanced: Converting non-integers from base 10 to base b (an integer)

Converting (e.g.) 851.5 from base 10 to base b can be done essentially as before, too, except that the "divide and find the remainder" process does not stop when we get to the "divide by 1" step—and may go on indefinitely, because a number with a finite decimal representations might have an infinite (repeating) representations in base b. For example, to convert 851.5 to base 7, we proceed like so:

Continuing this process yields the answer: .

Because the division process becomes particularly tedious when it involves negative powers of b, here is an alternative (equivalent) approach that only requires one division (followed by repeated multiplication): Let n be the number to be converted. As before, first determine the highest power of b that is smaller than n. Divide n by that highest power, obtaining a result in decimal form (rather than quotient/remainder form). The value to the left of the decimal point is the first digit in the base-b representation. Now do the following over and over: drop the digit(s) before the decimal, and multiply the part after the decimal by b; the value before the decimal in the result is the next digit in the base b representation.

Here is how that procedure would work to convert 851.5 to base 7:

Note that the leading digits in these products are the same as the quotients in the division process above. Meanwhile, the decimal portions of the products correspond to the remainders, divided by the corresponding power of 7—for example:

Advanced: Working with non-integer bases

Any number b > 1 can be used as a base. Converting from base b to base 10 is done using the concept of place value, exactly as before. Here are two examples:

Converting from base 10 to base b is done essentially as before, too, although the concept of "divide and find the remainder" is sometimes bit messier.

(More to come ...)

Note: This Web page has a shorter (and more memorable) alternate address: tinyurl.com/numberbases.