Subnet calculator › Guides
Subnet masks and CIDR, explained simply
Why 255.255.255.0 and /24 mean the same thing, and how to work out the network, broadcast and host count by hand.
An IP address is "network part + host part"
An IPv4 address is a 32-bit number written as four 8-bit pieces, like 192.168.1.130. Some leading bits say "which
network", and the rest say "which device on that network". The subnet mask marks where that boundary is.
Why 255.255.255.0 = /24
Written in binary, a mask is a run of 1s followed by all 0s.
255.255.255.0 = 11111111.11111111.11111111.00000000
└────── twenty-four 1s ──────┘
There are 24 ones, so it is written /24 — that is CIDR notation. In the same way,
255.255.255.192 has 26 ones and is /26.
Work it out by hand: 192.168.1.130/26
- Block size: 32 - 26 = 6 host bits, and 26 = 64. The last octet is cut at 0, 64, 128 and 192.
- Network address: 130 falls in the 128-191 block, so
192.168.1.128. - Broadcast address: the last address of the block,
192.168.1.191. - Usable hosts: everything in between,
192.168.1.129 - 192.168.1.190: 64 - 2 = 62.
Shortcut: 256 minus the last mask value = block size. For 255.255.255.192 that is 256 - 192 = 64. Check it in the calculator →
Wildcard masks
A wildcard mask is the subnet mask with its bits flipped: 255.255.255.192 becomes 0.0.0.63. Cisco ACLs and
OSPF use it to mean "do not compare these bits".
access-list 10 permit 192.168.1.128 0.0.0.63 Common sizes
| CIDR | Mask | Hosts | Typical use |
|---|---|---|---|
| /16 | 255.255.0.0 | 65,534 | A whole cloud VPC |
| /24 | 255.255.255.0 | 254 | Office or home LAN |
| /26 | 255.255.255.192 | 62 | Department VLAN |
| /28 | 255.255.255.240 | 14 | Smallest AWS subnet |
| /30 | 255.255.255.252 | 2 | Router-to-router link |
| /32 | 255.255.255.255 | 1 | Single host |
Are classes (A, B, C) still a thing?
Classful addressing was officially retired when CIDR arrived in 1993. Today "Class C" survives only in exams and old documents as shorthand for "a /24-sized block". In real designs you simply pick the prefix that fits.