CIDR Calculator
Find host count and subnet mask from a CIDR prefix.
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.