Understanding IP Addresses in Binary
Every IPv4 address is a 32-bit number, typically displayed as four decimal numbers (0-255) separated by dots. However, computers process these addresses in binary form. Understanding the binary representation is essential for subnetting, network troubleshooting, and understanding how IP addressing actually works.
Each of the four octets (8-bit groups) can represent values from 0 (00000000) to 255 (11111111). When we subnet a network, we're essentially manipulating these bits to create network and host portions. Our subnet calculator uses these binary operations to determine network boundaries.
Binary Basics
Each bit position has a value: 128, 64, 32, 16, 8, 4, 2, 1 (from left to right). Add the values where there's a 1 to get the decimal. For example, 11000000 = 128+64 = 192.
How to Convert IP to Binary
To convert each octet to binary, divide repeatedly by 2 and track remainders, or use the positional method:
Converting 192 to Binary
Start with 192, check each bit position:
- 128 ≤ 192? Yes → 1, remainder: 192-128=64
- 64 ≤ 64? Yes → 1, remainder: 64-64=0
- 32 ≤ 0? No → 0
- 16 ≤ 0? No → 0
- 8 ≤ 0? No → 0
- 4 ≤ 0? No → 0
- 2 ≤ 0? No → 0
- 1 ≤ 0? No → 0
Result: 11000000
Binary and Subnetting
Understanding binary is crucial for subnetting because subnet masks work at the bit level. A /24 subnet mask (255.255.255.0) in binary is:
11111111.11111111.11111111.00000000
The 1s mark network bits, and 0s mark host bits. When ANDing an IP with this mask, you extract the network address. Our network address calculator shows this operation visually.
Common Octet Values
| Decimal | Binary | Common Use |
|---|---|---|
| 0 | 00000000 | Network address (host portion) |
| 1 | 00000001 | First host, loopback |
| 128 | 10000000 | /25 subnet boundary |
| 192 | 11000000 | /26 subnet mask, Class C start |
| 224 | 11100000 | /27 subnet mask, Multicast start |
| 240 | 11110000 | /28 subnet mask |
| 248 | 11111000 | /29 subnet mask |
| 252 | 11111100 | /30 subnet mask |
| 255 | 11111111 | Broadcast (host portion), full mask octet |
For subnet mask conversions, use our netmask to CIDR converter. To understand wildcard masks (inverse of subnet masks), see our wildcard mask calculator.