KitJade

Networking 7 min read

CIDR and subnetting: how to read /24, /25 and everything in between

Published Updated By the KitJade editorial team

CIDR notation packs two facts into one short string: the network address and how many bits belong to the network. Once you can read that number, questions like “how many hosts fit here?” and “is this address inside that range?” become arithmetic instead of guesswork.

This guide uses IPv4 because that is where most day-to-day confusion happens. The same logic applies to IPv6 with much larger numbers.

What /24 actually means

An IPv4 address is 32 bits. A /24 says the first 24 bits identify the network and the remaining 8 identify the host. In dotted-decimal form, those 24 bits are the first three octets. So 192.168.1.0/24 covers 192.168.1.0 through 192.168.1.255.

The subnet mask is just another way to write the same idea: /24 is 255.255.255.0. The mask has 24 ones followed by eight zeros. A bitwise AND between an address and the mask produces the network address.

Worked example

Address:  192.168.1.130
Mask:     255.255.255.0  (/24)
Network:  192.168.1.0
Broadcast:192.168.1.255
Usable:   192.168.1.1 – 192.168.1.254  (254 hosts)

Splitting a /24 into smaller subnets

Borrow one host bit and you get two /25 blocks. Borrow two and you get four /26 blocks. Each borrowed bit doubles the subnet count and halves the host space. That is the whole trick.

For a /24, the four /26 blocks are 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26 and 192.168.1.192/26. Each contains 64 addresses; 62 are usable after reserving the network and broadcast addresses.

  • /25 → 2 subnets, 126 usable hosts each
  • /26 → 4 subnets, 62 usable hosts each
  • /27 → 8 subnets, 30 usable hosts each
  • /28 → 16 subnets, 14 usable hosts each

Point-to-point links and /31

RFC 3021 allows /31 on point-to-point IPv4 links. Both addresses are usable because there is no broadcast address on that kind of link, which makes /31 more efficient than the traditional /30. Many routers support it; check before standardising on it across a network you do not control.

Checking your answer quickly

For any block, the network address is the first address and the broadcast is the last. Usable hosts sit strictly between them. If an address falls outside the block's numeric range, it is not in that subnet — no matter how similar the first three octets look.

A subnet calculator is useful for checking the arithmetic, but try to predict the result first. The habit is what makes subnetting fast during an outage.

Frequently asked questions

Why subtract two hosts from an IPv4 subnet?
The first address identifies the network and the last is the directed broadcast address. Neither can be assigned to a normal host interface, so a /24 provides 254 usable addresses rather than 256.
Is 192.168.1.255 always a broadcast address?
Only if the prefix is /24 or shorter for that range. With a /25 split, 192.168.1.255 is the broadcast of the upper half, while 192.168.1.127 is the broadcast of the lower half. The mask decides, not the last octet alone.

Put it into practice