Writing a number in another base does not change its value: it changes how the digits represent it. The interactive number-systems lab lets you follow each conversion and play with powers of 2.
What does “base” mean?
In the decimal system we use ten digits, from 0 to 9. Each place is worth ten times the place to its right: 34710 = 3×10² + 4×10¹ + 7×10⁰. In base b, places instead have values 1, b, b², b³ and so on. Every digit must be smaller than b. In bases 11 through 16 we use A, B, C, D, E, F for values 10 through 15.
From base x to base 10: add place values
Read the digits from right to left and multiply by successive powers of the base. For example, 2A16 = 2×16¹ + 10×16⁰ = 32 + 10 = 4210. The letter A means 10; it is not a variable.
General formula: (dn…d1d0)x = dnxn + … + d1x + d0. This calculation also works when some digits are zero.
From base 10 to base y: repeated division
Divide the number repeatedly by y. Write down each remainder, then read them from last to first. Convert 4510 to base 2:
- 45 ÷ 2 = 22, remainder 1.
- 22 ÷ 2 = 11, remainder 0.
- 11 ÷ 2 = 5, remainder 1.
- 5 ÷ 2 = 2, remainder 1.
- 2 ÷ 2 = 1, remainder 0.
- 1 ÷ 2 = 0, remainder 1.
Reading upwards gives 1011012. Check: 32 + 8 + 4 + 1 = 45.
From base x to base y: base 10 as a bridge
Combine the previous two procedures. For example, 2314 = 2×4² + 3×4¹ + 1 = 32 + 12 + 1 = 4510. Converting 45 to base 2 by repeated division gives 1011012. Therefore 2314 = 4510 = 1011012.
The six-card number trick
Think of an integer from 1 to 63. We show you six cards, one at a time. For each card, answer only yes or no: is your number on it? Set aside the cards you answered no to. The first numbers on the remaining cards are 1, 2, 4, 8, 16 and 32; add them to recover your number.
Why does it work? These are the six powers of 2, the six places in a binary number. Every number from 1 to 63 has a unique combination of those powers. For example, 37 = 32 + 4 + 1: it appears exactly on the cards starting with 32, 4 and 1. Each card contains 32 numbers, precisely those whose corresponding binary place is 1. Answering no to all cards gives 0, outside the chosen range.
Try the interactive six cards: you can go back to the previous card or start over with another number.
Two more games in the lab
Binary lights: switch eight powers of 2 on or off to make a target from 1 to 255. Base challenge: solve ten conversions among bases 2 to 16, alternating the three methods explained above. After each answer, the correct value appears immediately.
An existing game: the poisoned bottle
Yes/no answers can also be read as binary digits in another problem: each bottle receives a distinct code, and the detector pattern identifies it. To explore this application, try The poisoned bottle, an online game already on the site. Six binary answers distinguish 2⁶ = 64 possibilities; twelve distinguish 2¹² = 4,096.
Try it yourself
- Convert 101102 to base 10.
- Convert 5810 to base 2.
- Convert 1325 to base 16 via base 10.
Worked answers
1) 101102 = 16 + 4 + 2 = 2210. 2) Dividing by 2 gives remainders that, read backwards, form 111010; hence 5810 = 1110102. 3) 1325 = 25 + 15 + 2 = 4210; 42 ÷ 16 = 2 with remainder 10, namely A. Thus 1325 = 2A16.
The lab handles non-negative integers; fractions and negative numbers need further conventions. Remember: another base changes the writing, not the number.