Skip to content
Local Only Dev Tools
6 min read

Understanding CIDR Notation

How prefixes, masks and host ranges work, with worked IPv4 examples.

Prefix length and masks

CIDR notation such as 192.168.1.0/24 means: start at this address, and treat the first 24 bits as the network. The remaining 8 bits identify hosts.

Useful addresses

The first address in a block is the network address and the last is the broadcast address. In a /24, that leaves 254 usable host addresses.

Special cases exist: /31 and /32 are commonly used for point-to-point links and single hosts.

Why it matters

CIDR is the foundation of subnetting, routing tables and cloud security groups. Getting the prefix wrong can expose more addresses than intended.

Try it yourself

Compute network address, broadcast address, usable host range and host count for a CIDR block. Runs locally in your browser.

Open CIDR Calculator