Subnet Calculator
Work out the network, broadcast address and host range for an IPv4 subnet.
About this tool
Accepts an address in CIDR form (10.0.0.5/8) or with a dotted subnet mask (10.0.0.5 255.0.0.0). Calculates the network, broadcast, first and last usable addresses, host counts, mask and wildcard mask for IPv4.
Setting up a network, writing firewall rules or studying for a networking exam all involve subnets: blocks of IP addresses defined by a prefix such as /24. Enter an IPv4 address with its prefix or subnet mask, and the calculator gives the network address, the broadcast address, the range of usable host addresses, how many hosts fit, the subnet mask and the wildcard mask used in router access lists.
How to use the Subnet Calculator
- Type an IPv4 address with a CIDR prefix, such as 192.168.1.130/26, or with a mask, such as 192.168.1.130 255.255.255.192.
- Read the network and broadcast addresses.
- Check the usable host range and how many hosts it holds.
- Use the mask or wildcard mask in your configuration.
Splitting 192.168.1.130/26
A /26 leaves 6 bits for hosts, so each subnet has 2^6 = 64 addresses, and the mask is 255.255.255.192. The address 192.168.1.130 falls in the block from 192.168.1.128 to 192.168.1.191. The network address is 192.168.1.128, the broadcast is 192.168.1.191, and the 62 usable hosts run from .129 to .190. The wildcard mask is 0.0.0.63.
How CIDR subnetting works
An IPv4 address is 32 bits, written as four numbers from 0 to 255. The prefix says how many of those bits identify the network; the rest identify hosts. A /24 has 8 host bits and 256 addresses, a /25 has 128, a /26 has 64, and so on, halving with each extra bit. The first address of each block is the network address and the last is the broadcast address, so usable hosts are two fewer than the total, except for /31 point-to-point links and single /32 addresses. The subnet mask writes the prefix as ones followed by zeros, and the wildcard mask is its inverse. The ranges 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private and are not routed on the public internet.
Frequently asked questions
How many hosts are in a /24?
256 addresses, of which 254 are usable once the network and broadcast addresses are removed.
What is a wildcard mask?
The inverse of the subnet mask, used in router access lists. For 255.255.255.0 it is 0.0.0.255.
Does this support IPv6?
No, this calculator is for IPv4 addresses only.
What is the difference between /31 and /32?
A /31 has two addresses for a point-to-point link with no broadcast; a /32 is a single host address.