digiwleea
The theory Tools Open the lab →

How does binary work?

Computers count with just two digits, 0 and 1. It sounds strange, but it is exactly the counting you already know, with one change: each place is worth twice the last, not ten times.

Click any bit to flip it, or press +1 to count and watch the carry roll over. Press Next to walk through it.

What just happened

In our everyday decimal system, the places are worth 1, 10, 100, 1000, each ten times the last, because we have ten digits (0 to 9). Binary has only two digits, so each place is worth twice the last: 1, 2, 4, 8, 16, 32, and so on, the powers of two. To read a binary number you just add up the place values wherever there is a 1. That is the whole system.

Counting is the same trick you learned as a kid: add 1, and when a column fills up, it rolls over and carries. In decimal a column rolls over at ten (9 to 10); in binary it rolls over at two (1 to 10). Computers use binary because the transistor they are built from is a switch with two clean states, off and on, which stand for 0 and 1. From there, once you can represent numbers, you can add them, multiply them, and build up to a whole computer. Need to convert a specific number? Use the binary converter. Curious how the bits become logic? See how logic gates work.

Common questions

How does binary work?

Binary uses only two digits, 0 and 1. Each position is a power of two (1, 2, 4, 8, ...), and a number is the sum of the place values where there is a 1. So 1011 = 8 + 2 + 1 = 11. Counting is add-one-and-carry.

How do you count in binary?

Add 1 each step; when a bit is already 1, it flips to 0 and carries 1 left. So: 0, 1, 10, 11, 100, 101, 110, 111, 1000 (that is 0 through 8). Just like decimal, but each column rolls over at 2 instead of 10.

How do you convert binary to decimal?

Add up the place values (powers of two) where the bit is 1. For 00101010, the 1s are in the 32, 8, and 2 places, so it is 32 + 8 + 2 = 42.

Why do computers use binary?

Because a transistor has two clean states, off and on (0 and 1). Two states are easy to build, tell apart, and copy without error. Everything (numbers, text, images) is encoded in those two symbols.

What is a byte?

A group of 8 bits. Eight bits give 28 = 256 patterns, so a byte holds a number from 0 to 255, a character, or one channel of a pixel's color.

Next: see how a computer adds in binary →

Embed this interactive

Free to embed in your course page, blog, or notes: just keep the credit link under the widget. Paste this where you want it:

<iframe src="https://digiwleea.wleeaf.dev/embed/tool/?w=binary" width="100%" height="470" style="border:0;border-radius:12px;max-width:600px" title="How binary works" loading="lazy"></iframe>