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

  1. Block size: 32 - 26 = 6 host bits, and 26 = 64. The last octet is cut at 0, 64, 128 and 192.
  2. Network address: 130 falls in the 128-191 block, so 192.168.1.128.
  3. Broadcast address: the last address of the block, 192.168.1.191.
  4. 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

CIDRMaskHostsTypical use
/16255.255.0.065,534A whole cloud VPC
/24255.255.255.0254Office or home LAN
/26255.255.255.19262Department VLAN
/28255.255.255.24014Smallest AWS subnet
/30255.255.255.2522Router-to-router link
/32255.255.255.2551Single 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.

More guides