IP Subnet Calculator
CIDR (10.0.0.5/16) or address then mask (10.0.0.5 255.255.0.0)
Try an example
Subnet
192.168.1.0/24
- Usable host range
- 192.168.1.1 – 192.168.1.254
- Usable hosts
- 254
- Broadcast address
- 192.168.1.255
- Total addresses
- 256
- Subnet mask
- 255.255.255.0
- Wildcard (inverse) mask
- 0.0.0.255
- Address type
- Private (RFC 1918): not routed on the public internet
- Legacy class
- Class C (classful addressing is obsolete; the prefix decides the subnet)
In binary
| Address | 11000000.10101000.00000001.00001010 |
|---|---|
| Mask | 11111111.11111111.11111111.00000000 |
| Network | 11000000.10101000.00000001.00000000 |
| Broadcast | 11000000.10101000.00000001.11111111 |
Bold bits are the network part (the first 24); the rest identify a host. The network address has every host bit 0, the broadcast address every host bit 1.
Divide into smaller subnets
Calculate an IPv4 subnet from an address with a CIDR prefix or a subnet mask: the network and broadcast addresses, the usable host range and count, the mask and wildcard mask, the address type, the bits in binary, and how the network divides into smaller subnets.
Formula
Worked Example
A /24 prefix leaves 8 host bits, so the subnet has 2⁸ = 256 addresses. The first (all host bits 0) names the network and the last (all 1) is the broadcast address, leaving 254 for devices.
Frequently Asked Questions
What does /24 mean in an IP address?
It is the prefix length: the first 24 bits are the network part and the remaining 8 identify hosts. /24 is the same as the mask 255.255.255.0; /16 is 255.255.0.0 and /8 is 255.0.0.0.
Why are two addresses in every subnet unusable?
The address with all host bits 0 identifies the network itself and the one with all host bits 1 is the broadcast address. The exceptions are /31, used for point-to-point links where both addresses are usable (RFC 3021), and /32, a single host.
Which IP addresses are private?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). They are free for anyone to use inside a network and are not routed on the public internet; a router translates them to a public address with NAT.
Common Mistakes
- !Using the network or broadcast address for a device.
- !Confusing the subnet mask with the wildcard mask used in router access lists: 255.255.255.0 corresponds to the wildcard 0.0.0.255.