CIDR Calculator

Find host count and subnet mask from a CIDR prefix.

Usable hosts 254
Subnet mask 255.255.255.0
Total addresses 256

Formula: addresses = 2^(32 - prefix); hosts = addresses - 2

Step-by-step with your numbers:
1. Values used:
2. Prefix length (/n) = 24
3.
4. Usable hosts = 254
5. Subnet mask = 255.255.255.0
6. Total addresses = 256
Did we solve your problem today?

A CIDR prefix defines how many addresses a subnet holds.

The math behind it

A /n prefix gives 2^(32-n) addresses; subtract 2 (network and broadcast) for usable hosts.

Worked example

/24 gives 254 usable hosts and mask 255.255.255.0.

FAQ

Why subtract 2?

The first address is the network ID and the last is the broadcast address.