πŸ’» Binary Numbers Explorer

How computers count with only 0s and 1s Β· Visual bit display Β· Grades 5–8

πŸ”’ Decimal ↔ Binary Converter
DECIMAL (0–255)
↔
BINARY
πŸ“– How Binary Works

Inside a computer chip, each tiny switch is in one of two states, often called OFF (0) and ON (1). That's why everything in a computer is stored as binary: a series of 1s and 0s called bits.

1 Bit
0 or 1
8 Bits = 1 Byte
Stores 0–255
1 KB = 1,000 Bytes
About a paragraph of plain text
1 GB = 1 Billion Bytes
Hundreds of MP3 songs
🎯 Binary Quiz!

πŸ” Flip the Bits: Binary to Decimal

Tap a box to turn that bit on (1) or off (0), or type a binary number with up to 16 digits. The decimal value is the sum of the places that are on.

πŸ”€ Your Name in Binary

Computers store letters as numbers too. In the ASCII code, capital A is 65, B is 66 and so on, and each number is saved as one byte. Type a name or word (up to 12 characters).

ASCII codes: RFC 20, ASCII format for network interchange (1969). Letters outside basic ASCII, like Γ© or emoji, use more than one byte in today's Unicode text, so this tool skips them.

Binary Numbers: How Computers Count With Two Digits

Every photo, song, game and text message on a device is stored as long strings of two digits, 0 and 1. That is the binary (base-2) number system. Each 0 or 1 is called a bit, and inside a computer chip each bit is held by a tiny electronic switch that is in one of two states, often described as off and on. Two states are easy for hardware to tell apart reliably, which is why computers count this way.

The converter above takes a whole number from 0 to 255 and shows it as 8 bits, one full byte. Each bit sits in a box labeled with its place value (128, 64, 32, 16, 8, 4, 2, 1). Boxes that are "on" light up green, and the line underneath adds up the lit values so students can check the conversion themselves. For a number above 255, the tool shows its full binary and how many bits it needs, because 255 is the biggest number 8 bits can hold. The quiz below the converter asks four short questions and loops back to the start.

Place Value, Just With Twos

Binary is the same idea as our everyday base-10 system, only with a different multiplier. In base 10, each place is worth 10 times the place to its right: ones, tens, hundreds, thousands. In base 2, each place is worth 2 times the place to its right: ones, twos, fours, eights, sixteens and so on. A student who really understands why the 3 in 300 means "three hundreds" is ready for binary, and working in a new base is one of the best ways to check that place value is understood rather than memorized.

Worked example: binary to decimal

Take binary 1011. Read the places from right to left: 1 one, 1 two, 0 fours, 1 eight. Add the places that have a 1: 8 + 2 + 1 = 11. Try it in the tool by typing 11; the boxes for 8, 2 and 1 light up and the line reads "11 = 8 + 2 + 1".

Worked example: decimal to binary

To write 42 in binary, start at the biggest place that fits. 64 is too big, so that bit is 0. 32 fits: 42 − 32 = 10. 16 is too big (0). 8 fits: 10 − 8 = 2. 4 is too big (0). 2 fits: 2 − 2 = 0. The 1s place is 0. Reading the bits from 128 down gives 00101010, which is 101010 without the leading zeros. The tool opens on 42 so students can compare their answer straight away.

Why 8 bits stop at 255

With all 8 bits on, the total is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. Counting zero as well, one byte can hold 256 different values. Each extra bit doubles the count: 1 bit gives 2 values, 2 bits give 4, 3 bits give 8, and 8 bits give 28 = 256.

Using It in Class or at Home

  1. Start unplugged. CS Unplugged's binary lesson uses five cards with 1, 2, 4, 8 and 16 dots. Face up means 1, face down means 0. Ask a row of five students to hold the cards and show 9 (8 + 1) or 21 (16 + 4 + 1). With all five face up the total is 31.
  2. Move to the converter. Have students predict the bits for a number before typing it, then check. Good starting numbers are powers of two (1, 2, 4, 8, 16) because only one box lights up.
  3. Look for patterns. Type 1, 2, 3, 4 ... 16 in order and watch the 1s box. It flips every time, the 2s box every second number, the 4s box every fourth. Ask: which numbers always end in 1? (The odd ones.)
  4. Finish with the quiz. The four questions cover reading binary, writing a small number, what a byte can hold and what each place means.

A quick challenge for early finishers: what is the biggest number you can show with 4 bits? (1111 = 15.) With 5 bits? (31.) Can they spot the rule? (One less than the next power of two.)

Common Mix-Ups

Where to Go Next

Questions Parents and Teachers Ask

What grade is binary appropriate for?

CS Unplugged suggests its first binary lesson for ages 8 to 10, so upper elementary students can do the card activity. The full 8-bit converter and the math behind it fit grades 5 to 8 well, where students are already working with place value and exponents.

Why do computers use binary instead of base 10?

Each bit is stored by an electronic part that only needs to be in one of two clearly different states. Telling two states apart is far more reliable than telling ten levels apart, so the hardware is simpler and makes fewer errors.

Can the tool convert binary to decimal?

Yes. In Flip the Bits, tap any box to switch that bit on or off, or type a binary number such as 1011, and the decimal value appears with the place values added up. The quiz also includes a binary-to-decimal question.

Is a kilobyte 1,000 or 1,024 bytes?

Officially, kilo means 1,000, so a kilobyte is 1,000 bytes. A kibibyte (KiB) is 1,024 bytes. Many programs still use "KB" for 1,024, which is why storage sizes can look slightly different on different devices.

Standards Connections

CSTA 2-DA-07 (grades 6-8): "Represent data using multiple encoding schemes." Math connection: CCSS 5.NBT.A.1, which asks students to recognize that each place in a multi-digit number is worth 10 times the place to its right; binary is the same idea with a factor of 2.

Sources

Last reviewed: November 2026 · Supports CSTA 2-DA-07 and CCSS 5.NBT.A.1

🌟 Keep Exploring
πŸ€–How AI Works 🧱Base Ten Blocks 🎨Pixel Art