The Binary Number System- A Beginner's Complete Guide

What the Heck Is Binary Anyway?

Binary is a number system that uses only two digits: 0 and 1. That's it. No 2s, no 3s, nothing fancy. Your computer runs on this. Every pixel on your screen, every letter you're reading right now, every video you've ever watched—all of it comes down to strings of 0s and 1s.

Humans use decimal (base-10). You have ten fingers, so it made sense historically. But computers don't have fingers. They have electrical circuits that are either on or off. On = 1, Off = 0. Binary is the language that matches how hardware actually works.

Why Binary, Not Something Else?

You could theoretically build a computer using any number system. The USSR actually built a ternary computer (base-3) called Setun in 1958. It didn't catch on.

Binary won because it's dead simple to implement in hardware. Transistors are either conducting or not conducting. Capacitors are charged or not charged. Two states. Reliable. Cheap. Easy to distinguish between noise and signal.

With decimal, you'd need to distinguish between 10 different voltage levels. That's error-prone and expensive. With binary, you only need to detect two levels. Much more reliable.

The Place Values in Binary

This is where most people get confused. In decimal, you have ones place, tens place, hundreds place, and so on—each place value is 10 times larger than the previous.

Binary works the same way, except each place value is 2 times larger than the previous:

See the pattern? Each step doubles the value. This is called powers of 2, and memorizing these will save you hours of frustration later.

Reading Binary Numbers

Let's break down the binary number 11010:

Starting from right to left, assign place values:

1 1 0 1 0
16 8 4 2 1

Multiply each digit by its place value and add them up:

16 + 8 + 0 + 2 + 0 = 26

So 11010 in binary equals 26 in decimal. That's all there is to it.

How to Convert Decimal to Binary

The division method works every time. Take your decimal number and divide by 2 repeatedly, keeping track of the remainders. When you're done, read the remainders from bottom to top.

Let's convert 42 to binary:

Read from bottom to top: 101010

Let's verify: 1×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1 = 32 + 8 + 2 = 42. Correct.

Binary Addition—No Carrying Tricks

Binary addition follows four simple rules:

When you get 1 + 1 + 1 (with a carry from the previous column), you get 11, which is 1 with a carry of 1.

Example: 101 + 011

  101
+ 011
------
 1000

Starting from the right: 1+1=10, write 0 carry 1. Next column: 0+1+carry1=10, write 0 carry 1. Next: 1+0+carry1=10, write 0 carry 1. Finally, write the carry. Result: 1000 (which is 8 in decimal).

Bits, Bytes, and What They Mean

A single binary digit is called a bit. That's a 0 or a 1.

Eight bits make a byte. One byte can represent 256 different values (0-255). This is why 8-bit color gives you 256 shades per channel, why old game consoles were called "8-bit," and why IPv4 addresses are broken into four bytes.

Common groupings you'll see:

Where Binary Shows Up in Real Life

ASCII and Text Encoding

Every character you type gets assigned a number. The letter 'A' is 65. 'a' is 97. '0' (zero) is 48. In binary, 'A' is 01000001. Your computer stores text by storing these numbers.

IPv4 Addresses

192.168.1.1—each number is a byte (0-255). The entire address is 32 bits. That's why IPv4 only supports about 4 billion unique addresses, which we've nearly exhausted.

RGB Color Codes

#FF5733—each pair of hex digits represents a byte for Red, Green, and Blue intensity. Each color channel goes from 0 to 255. That's 256 × 256 × 256 = 16.7 million possible colors.

Boolean Logic

TRUE and FALSE. 1 and 0. Every comparison your code makes—if (x > 5)—boils down to binary decisions. This is why we call it boolean after mathematician George Boole.

Quick Reference: Binary to Decimal

Binary Decimal Notes
0000 0 Nothing
0001 1 2⁰
0010 2
0100 4
1000 8
1111 15 Maximum 4-bit value
11111111 255 Maximum byte value
10000000 128 Highest bit in a byte

Getting Started: Practice Problems

You won't learn this by reading. You have to do it yourself.

Convert these decimals to binary:

  1. 7 → 111
  2. 15 → 1111
  3. 100 → 1100100
  4. 255 → 11111111

Convert these binary numbers to decimal:

  1. 1010 → 10
  2. 11111111 → 255
  3. 10000000 → 128
  4. 01010101 → 85

Check your answers with a calculator. The Windows calculator in programmer mode shows you binary, decimal, hex, and octal simultaneously. Use it.

The Bottom Line

Binary isn't complicated. It's just base-2 instead of base-10. The math is elementary. The reason it seems hard is that nobody bothered to explain it properly, and most explanations throw unnecessary jargon at you.

You now know everything you need to understand how computers actually store and process information at the fundamental level. The rest is just building on these basics.