Subnet Calculator

IPv4 network, broadcast, mask, hosts and class from CIDR.

Example: 10.0.0.5 with prefix 8, or 192.168.1.10 with prefix 24.

How the Subnet works

The prefix length fixes the mask: bits above it form the network, the rest are host bits. All ones in the host portion gives the broadcast address, all zeros the network address.

Mask = 2^(32 − prefix) addresses