Subnet Calculator
Enter an IPv4 address and CIDR prefix to instantly calculate the network address, broadcast address, usable host range, subnet mask and total hosts.
How to use
What CIDR notation means
CIDR (Classless Inter-Domain Routing) writes a network as an IP plus a prefix length, like 192.168.1.0/24. The /24 means the first 24 bits identify the network, leaving 8 bits for hosts.
Network vs broadcast vs hosts
The network address is the first address in the block, the broadcast is the last, and everything in between is usable for devices. A /24 has 256 total addresses and 254 usable hosts.
The subnet mask
The prefix length maps to a dotted mask: /24 is 255.255.255.0, /16 is 255.255.0.0. The wildcard mask is its inverse and is used in access control lists on Cisco devices.
CIDR was introduced in 1993 to slow the exhaustion of IPv4 addresses by replacing the rigid Class A/B/C system with flexible prefix lengths — it extended the usable life of IPv4 by decades.
Frequently asked questions
How many usable hosts are in a subnet?
Usable hosts equal 2 raised to the number of host bits, minus 2 — one address is reserved for the network and one for the broadcast. A /24 has 8 host bits, so 2^8 − 2 = 254 usable hosts. A /30 has just 2 usable addresses, which is why it's common for point-to-point links.
What is the difference between a /24 and a /16?
A /24 reserves 24 bits for the network and 8 for hosts, giving 254 usable addresses — typical for a single LAN. A /16 reserves only 16 network bits and 16 host bits, giving 65,534 usable addresses across a much larger network. The smaller the prefix number, the bigger the network.
Why are the network and broadcast addresses not usable?
The first address in any subnet identifies the network itself and the last is the broadcast address used to reach every host at once. Neither can be assigned to an individual device, which is why the usable host count is always two fewer than the total address count.