💻 Computer Science · Topic 12 of 80

Converting Binary and Decimal

Convert by adding the place values of the 1s.

Interactive labClick bits to count in binary

About this topic

To convert binary to decimal, write the place values (1, 2, 4, 8, ...) above each bit and add the values wherever there is a 1. To convert decimal to binary, repeatedly divide by 2 and record the remainders, then read them from last to first, or subtract the largest power of 2 that fits.

For example, 1101 in binary is 8 plus 4 plus 0 plus 1, which equals 13. To turn 13 into binary by division: 13 divided by 2 is 6 remainder 1, 6 divided by 2 is 3 remainder 0, 3 divided by 2 is 1 remainder 1, and 1 divided by 2 is 0 remainder 1. Reading the remainders from bottom to top gives 1101.

These conversions matter whenever you work with IP addresses, colours, permissions or low-level programming. A common error is reading the remainders in the wrong order, so remember that the last remainder is the leftmost bit. Another is forgetting that the rightmost bit has place value 1, not 2. Check your answer by converting it back. The largest value of an 8-bit number is 255, which is why many values in computing stop at 255.

Key ideas

  1. Place values 128, 64, 32 … 1
  2. Divide by 2 repeatedly to go to binary
  3. Practice builds speed

Quick check

Use cases: where Converting Binary and Decimal helps

Computing ideas run phones, search engines, games and the wider internet.

Frequently asked questions

What is Converting Binary and Decimal?

Convert by adding the place values of the 1s.

What will I learn in Converting Binary and Decimal?

Place values 128, 64, 32 … 1. Divide by 2 repeatedly to go to binary. Practice builds speed.

Is Converting Binary and Decimal part of Computer Science?

Yes. It is one of 80 Computer Science topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.

Does the Converting Binary and Decimal lab work on a phone or tablet?

Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.

How should I study Converting Binary and Decimal?

Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.

Do I need an account, and is my progress saved?

No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.

More in Computer Science