Subnet Calculator

Network address, broadcast address, mask and usable hosts for any IPv4 address and CIDR.

How it works

Enter an IPv4 address and a prefix length. The tool gives the network and broadcast address, the mask, the wildcard mask, the first and last usable host and the number of hosts.

The formula

hosts = 2^(32 - prefix) - 2

Worked example

192.168.1.10/24: network 192.168.1.0, broadcast 192.168.1.255, 254 usable hosts from .1 to .254.

Good to know

Common questions

Why minus 2?
The first address names the network and the last is the broadcast.
What is a wildcard mask?
The inverse of the subnet mask, used in router access lists.
Does it do IPv6?
No.

More in CS Labs & Coding.