🌐 What is Binary?

Think of it like a light switch:

Binary is a number system that only uses TWO digits: 0 and 1. It's how computers think!

Real-World Analogy:

💡 0 = Light is OFF

💡 1 = Light is ON


Computers use billions of tiny switches (transistors) that can only be ON or OFF. That's why they use binary!

We use decimal (base 10): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Computers use binary (base 2): 0, 1

🔢 How Binary Numbers Work

In decimal (what we use every day):

Each position represents a power of 10:

Thousands
Hundreds
Tens
Ones
10³
10²
10¹
10⁰
1000
100
10
1

Example: 1234 = (1×1000) + (2×100) + (3×10) + (4×1)

In binary (what computers use):

Each position represents a power of 2:

128
64
32
16
8
4
2
1
2⁷
2⁶
2⁵
2⁴
2⁰

Example: Binary 10110010 = (1×128) + (0×64) + (1×32) + (1×16) + (0×8) + (0×4) + (1×2) + (0×1) = 178

🎯 Converting Decimal to Binary (Simple Method)

The Division Method (easiest for students!):

Example: Convert 192 to binary
  1. Divide 192 by 2 = 96 remainder 0
  2. Divide 96 by 2 = 48 remainder 0
  3. Divide 48 by 2 = 24 remainder 0
  4. Divide 24 by 2 = 12 remainder 0
  5. Divide 12 by 2 = 6 remainder 0
  6. Divide 6 by 2 = 3 remainder 0
  7. Divide 3 by 2 = 1 remainder 1
  8. Divide 1 by 2 = 0 remainder 1

Read remainders from BOTTOM to TOP: 11000000

The Subtraction Method (used in our tool):

Example: Convert 192 to binary
  1. Is 192 ≥ 128? YES → Write 1, subtract: 192-128 = 64
  2. Is 64 ≥ 64? YES → Write 1, subtract: 64-64 = 0
  3. Is 0 ≥ 32? NO → Write 0
  4. Is 0 ≥ 16? NO → Write 0
  5. Is 0 ≥ 8? NO → Write 0
  6. Is 0 ≥ 4? NO → Write 0
  7. Is 0 ≥ 2? NO → Write 0
  8. Is 0 ≥ 1? NO → Write 0

Result: 11000000

🔄 Converting Binary to Decimal

The Addition Method:

Example: Convert 11000000 to decimal

Write the position values:

128
1
1 × 128 = 128
64
1
1 × 64 = 64
32
0
0 × 32 = 0
16
0
0 × 16 = 0
8
0
0 × 8 = 0
4
0
0 × 4 = 0
2
0
0 × 2 = 0
1
0
0 × 1 = 0

Add them up: 128 + 64 + 0 + 0 + 0 + 0 + 0 + 0 = 192

💡 Why IP Addresses Use Binary

Computers don't understand decimal numbers!

When you type an IP address like 192.168.1.10, your computer immediately converts it to binary:

11000000.10101000.00000001.00001010

Why 32 bits?

An IPv4 address is exactly 32 bits long (four octets of 8 bits each).

8 + 8 + 8 + 8 = 32 bits total

This allows for 2³² = 4,294,967,296 possible IP addresses!

In networking:

  • Routers work with binary addresses
  • Subnet masks are easier to understand in binary
  • Network calculations use binary AND operations
  • Understanding binary helps you understand subnetting!

📊 Quick Binary Reference Table

Decimal
Binary
Decimal
Binary
0
00000000
128
10000000
1
00000001
192
11000000
128
10000000
224
11100000
64
01000000
240
11110000
255
11111111
252
11111100

❓ Common Questions

Why do we need to learn binary?

Understanding binary helps you:

  • Understand how subnet masks work
  • Calculate network addresses quickly
  • Troubleshoot network problems
  • Pass networking certification exams!

What's the largest number in 8 bits?

The largest 8-bit binary number is 11111111, which equals 255 in decimal. That's why each octet of an IP address can only be 0-255!

How do I remember the position values?

Easy! Start with 1 and keep doubling:

1, 2, 4, 8, 16, 32, 64, 128

Or backwards: 128, 64, 32, 16, 8, 4, 2, 1

Is there an easier way to convert?

Yes! Use this tool! 😊 But learning the manual method helps you understand WHY the conversion works, which is super important for networking!