courses › Number Theory

Number bases

level 25 course

Binary and hexadecimal: the numbers computers use.

Pen and paper is fine · no calculator needed why?

Learn first (about 3 minutes)

Opens at level 25.

Sign in to start

Builds on: Exponents & roots (not open yet)

the lesson

The idea, the techniques and a tip for each skill, right here. The Learn page adds worked examples for every skill and untimed practice.

Read the lesson · about 3 minutes

The idea

Our numbers are base 10: each place is worth ten times the place to its right. Other bases work the same way with a different multiplier.

Binary (base 2) uses only the digits 0 and 1, and its places are 1, 2, 4, 8, 16, 32 and so on, doubling from the right. Computers use it because a switch is either off or on.

Hexadecimal (base 16) needs sixteen digits, so after 9 come the letters A to F for 10 to 15. Its places are 1, 16, 256 and so on.

Techniques

Add the places that are on

Turning a binary number into decimal.

  1. Write the place values over the digits: 1 on the right, doubling as you go left.
  2. Add the place values that have a 1 under them.
worked example

Example: What is the binary number 1 0 1 1 0 1 in decimal? Its digits are spaced out for reading.

  1. Places from the right: 1, 2, 4, 8, 16, 32.
  2. The 1s sit under 32, 8, 4 and 1.
  3. 32 + 8 + 4 + 1 = 45.

Answer: 45

Take the biggest power of 2

Turning a decimal number into binary.

  1. Find the largest power of 2 that fits, and take it away.
  2. Repeat with what is left until nothing remains.
  3. Write 1 in each place you used and 0 in the others, largest place first.
  4. 37 is 32 + 4 + 1, which gives the digits 1 0 0 1 0 1.
worked example

Example: Write 6 in binary.

  1. 6 = 4 + 2.
  2. Places 4, 2 and 1 get 1, 1 and 0.
  3. So 6 is 110 in binary.

Answer: 110

Sixteens and ones

Turning a hexadecimal number into decimal.

  1. Swap each letter for its value: A is 10, B 11, C 12, D 13, E 14, F 15.
  2. Two digits: the left one counts sixteens and the right one counts ones.
  3. Three digits: the places are 256, 16 and 1.
worked example

Example: What is hexadecimal 3C in decimal?

  1. C is 12.
  2. 3 × 16 + 12 = 48 + 12 = 60.

Answer: 60

Tips by skill

  • TipBinary to decimal: Label the places 1, 2, 4, 8 and so on from the right, then add the places holding a 1.
  • TipDecimal to binary: Take away the largest power of 2 that fits, again and again. Each power used is a 1; every other place is 0.
  • TipHexadecimal: Letters stand for 10 to 15. The places from the right are 1, 16 and 256: multiply and add.

Watch out for

  • Reading binary place values from the wrong end. The rightmost digit is always the 1s place.
  • Writing a binary answer backward. The largest place comes first. If you halve repeatedly instead, read the remainders from last to first.
  • Treating hexadecimal places as tens. 2F is 2 sixteens and 15 ones, which is 47, not 35.

skills · practice stats

From rounds of this course only: box, review and test-out answers are left out. Once a skill has 40 tries, it compares your first 20 tries with your last 20.

rest ladder

Win 3 of your last 4 rounds and the course rests. A win is 90% right, within 2× the round's par. Pass the review when it comes back and the next rest is longer.

  1. 1 day
  2. 3 days
  3. 7 days
  4. 14 days
  5. 30 days
  6. 60 days
  7. mastered · every 90 days

your rounds

No rounds yet.