IPv4 CIDR and subnet ranges

Read a slash prefix, find the subnet boundary, and count total and usable addresses.

Classless Inter-Domain Routing writes an IPv4 address with a prefix such as 192.168.1.42/24. The prefix identifies how many of the 32 bits belong to the network.

Use the IPv4 CIDR Calculator to inspect a specific range.

What the prefix changes

A longer prefix leaves fewer host bits and produces a smaller range. A /24 has 8 host bits and 256 total addresses.

Network and broadcast addresses

Set every host bit to zero for the network address and every host bit to one for the broadcast address.

Usable host rules

Traditional subnets reserve the first and last addresses. A /31 uses both addresses for a point-to-point link, while a /32 identifies one address.