Other

CIDR Calculator

Find host count and subnet mask from a CIDR prefix.

Parameters Live Compute
Calculated Output
Usable hosts 254
Subnet mask 255.255.255.0
Total addresses 256
Formula: addresses = 2^(32 - prefix); hosts = addresses - 2
Step-by-Step Breakdown
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 this calculator solve your problem today?
Report issue to loopingon.com
Sponsored

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.

Frequently Asked Questions

Why subtract 2?

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

Advertisement