Subnetting 101
Step 1 — Binary Fundamentals
Binary is the foundation of subnetting. Before touching IP addresses, you need to understand how binary works. This step teaches you from absolute zero — no prior knowledge required.
What is Binary?
Binary is a number system that uses only two digits: 0 and 1. Every number we use in networking can be represented in binary.
Computers use binary because they store information as on/off switches. Each switch is a bit — either 0 (off) or 1 (on).
Why 8 Bits = 255
An octet is exactly 8 bits. With 8 switches, you can create 256 different combinations (2⁸ = 256). Since we start counting at 0, the range is 0 to 255.
Minimum: 00000000 = 0
Maximum: 11111111 = 255
Total combinations: 256 (0-255)
Binary Place Values
Just like decimal has place values (ones, tens, hundreds), binary has place values. Each position doubles as you move left.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Memorize these values: 128, 64, 32, 16, 8, 4, 2, 1. This pattern appears constantly in subnetting.
Converting Decimal to Binary
To convert a decimal number to binary, start from the left and ask: "Can this place value fit?" If yes, put a 1 and subtract. If no, put a 0.
Example: Convert 192 to binary
- 192 ≥ 128? Yes → write 1, remainder = 192 - 128 = 64
- 64 ≥ 64? Yes → write 1, remainder = 64 - 64 = 0
- 0 ≥ 32? No → write 0
- 0 ≥ 16? No → write 0
- 0 ≥ 8? No → write 0
- 0 ≥ 4? No → write 0
- 0 ≥ 2? No → write 0
- 0 ≥ 1? No → write 0
Result: 192 = 11000000
Example: Convert 85 to binary
- 85 ≥ 128? No → write 0
- 85 ≥ 64? Yes → write 1, remainder = 85 - 64 = 21
- 21 ≥ 32? No → write 0
- 21 ≥ 16? Yes → write 1, remainder = 21 - 16 = 5
- 5 ≥ 8? No → write 0
- 5 ≥ 4? Yes → write 1, remainder = 5 - 4 = 1
- 1 ≥ 2? No → write 0
- 1 ≥ 1? Yes → write 1, remainder = 1 - 1 = 0
Result: 85 = 01010101
Converting Binary to Decimal
Add up the place values where there's a 1.
Example: Convert 11001100 to decimal
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
Add the place values where there's a 1:
128 + 64 + 8 + 4 = 204
Practice Exercises
Do these now. Don't skip ahead until you can solve them quickly.
Quick note
Your answers are saved in your browser so you can come back later. For binary, you can type either 8 bits or fewer bits (we'll pad with leading zeros when checking).
1. Convert to binary:
- 255
- 128
- 64
- 224
- 10
2. Convert to decimal:
- 10110101
- 11001111
- 00111100
- 10011001
- 01011010
Show Answers
1. Decimal to Binary:
- 255 = 11111111
- 128 = 10000000
- 64 = 01000000
- 224 = 11100000
- 10 = 00001010
2. Binary to Decimal:
- 10110101 = 181 (128 + 32 + 16 + 4 + 1)
- 11001111 = 207 (128 + 64 + 8 + 4 + 2 + 1)
- 00111100 = 60 (32 + 16 + 8 + 4)
- 10011001 = 153 (128 + 16 + 8 + 1)
- 01011010 = 90 (64 + 16 + 8 + 2)
Checkpoint
Before moving to Step 2, make sure you can:
- Explain why 8 bits gives us 0-255 (256 values)
- Recite the place values from memory: 128, 64, 32, 16, 8, 4, 2, 1
- Convert any decimal (0-255) to binary without hesitation
- Convert any 8-bit binary back to decimal
If any of these feel shaky, practice more. Subnetting builds on this foundation.