Learn Binary- A Beginner's Guide to Binary Numbers
What Binary Actually Is
Binary is a number system with only two digits: 0 and 1. That's it. Your computer doesn't understand words, images, or videos—it only understands these two states. Everything your phone, laptop, or server does comes down to billions of zeros and ones being flipped on and off.
The term "binary" comes from the Latin binarius, meaning "two by two." You already use multiple number systems without thinking about it. Hours use base-60 (minutes and seconds). A foot is 12 inches. But binary is the simplest possible number system, and that's exactly why computers use it.
Why Computers Use Binary
Electronic circuits have two states: on or off. A capacitor holds a charge (1) or it doesn't (0). A switch is open or closed. It's physically simple to build systems that distinguish between exactly two states.
If computers used decimal (0-9), every circuit would need to distinguish between ten voltage levels. That's error-prone and expensive. Binary gives you noise margin—you can be way off on voltage and still correctly read 0 versus 1.
How Binary Numbers Work
Each position in a binary number represents a power of 2. Reading from right to left:
- First digit: 2⁰ = 1
- Second digit: 2¹ = 2
- Third digit: 2² = 4
- Fourth digit: 2³ = 8
- And so on...
So the binary number 1011 breaks down as:
- 1 × 8 = 8
- 0 × 4 = 0
- 1 × 2 = 2
- 1 × 1 = 1
- Total: 11
Binary to Decimal Conversion
Here's the straightforward process:
- Write down the powers of 2 from right to left (1, 2, 4, 8, 16, 32, 64...)
- Multiply each digit by its corresponding power
- Add up the results
Let's convert 110100 to decimal:
- Starting from the right: positions 0-5
- 0×1 + 0×2 + 1×4 + 0×8 + 1×16 + 1×32
- 0 + 0 + 4 + 0 + 16 + 32 = 52
Binary 110100 = 52 in decimal.
Quick Reference Table
| Binary | Decimal | Hex |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0100 | 4 | 4 |
| 1000 | 8 | 8 |
| 1111 | 15 | F |
| 1010 | 10 | A |
Decimal to Binary Conversion
Use the division method:
- Divide your number by 2
- Write down the remainder (0 or 1)
- Divide the result by 2, keep track of remainders
- Stop when you reach 0
- Read the remainders bottom to top
Converting 23 to binary:
- 23 ÷ 2 = 11 remainder 1
- 11 ÷ 2 = 5 remainder 1
- 5 ÷ 2 = 2 remainder 1
- 2 ÷ 2 = 1 remainder 0
- 1 ÷ 2 = 0 remainder 1
Read bottom to top: 10111 = 23 in decimal.
Understanding Binary Digits (Bits)
A single binary digit is called a bit. Eight bits make a byte. Here's how values stack up:
- 1 bit: 2 values (0-1)
- 4 bits (nibble): 16 values (0-15)
- 8 bits (byte): 256 values (0-255)
- 16 bits (word): 65,536 values
- 32 bits: over 4 billion values
When you hear "32-bit" or "64-bit" systems, that's how many bits the processor handles in a single operation.
How Text Becomes Binary
ASCII assigns a number to each character. The letter A is 65. The letter a is 97. The number 0 is 48.
65 in binary is 01000001. That's how your computer stores the letter A in memory.
Unicode (UTF-8) expands this to handle virtually every language and symbol on Earth. Emoji are just numbers in Unicode that your system renders as colorful pictures.
Binary in Everyday Tech
You interact with binary constantly:
- IP addresses: IPv4 addresses are 32-bit numbers like 192.168.1.1 (each octet is 8 bits)
- Colors: RGB values range 0-255 (8 bits each), so #FF0000 is red because each channel gets max value
- File sizes: Kilobytes, megabytes, gigabytes—they're all powers of 2
- Permissions: Unix file permissions use binary flags (read=4, write=2, execute=1)
Getting Started: Practice Exercises
Here's how to actually learn this:
- Grab paper and a pen. Don't use a calculator yet.
- Convert 0-15 to binary. Write out 0000 through 1111. Notice the patterns.
- Convert these decimals to binary: 7, 16, 42, 100, 255
- Convert these binary numbers to decimal: 1010, 11111111, 10000000
- Check your answers with a calculator in programmer mode
After you can do those without thinking, you understand binary. It takes most people 20-30 minutes of practice.
Common Mistakes to Avoid
People mess up binary in predictable ways:
- Reading it backwards. Always start from the rightmost digit—that's the ones place.
- Forgetting place values. Write them out until they're automatic.
- Confusing binary with decimal. Binary 10 is not ten. It's two. Binary 100 is four.
- Ignoring leading zeros. 00101 and 101 are the same value, but context matters in computing.
Where to Go From Here
Once binary clicks, you're ready for:
- Hexadecimal: Base-16 (0-9, A-F), used because it maps perfectly to 4 binary digits
- Octal: Base-8, used in Unix file permissions
- Boolean logic: AND, OR, XOR operations on binary values
- Two's complement: How computers represent negative numbers
Understanding binary isn't optional trivia—it's the foundation for everything else in computing. If you want to debug code, understand memory, or work with networking, you need this.
Start practicing. It clicks faster than you expect.