IP & Domain Tools

IPv4 Subnet Calculator

Enter an IPv4 address and prefix length to get the network, broadcast, mask and host range.

Your numbers

Your results

Network address
Network address
—
Subnet mask
—
Wildcard mask
—
Broadcast address
—
First usable host
—
Last usable host
—
Total addresses
—
Usable hosts
—

IPv4 Subnet Calculator by TheCalcTools

How the IPv4 Subnet Calculator works

Enter the four octets of an IPv4 address and the prefix length from the CIDR notation (for example /26).

The prefix length says how many leading bits identify the network. The remaining bits identify hosts, so the block holds 2^(32 − prefix) addresses.

The network address is the first address in the block and the broadcast address is the last. Usable hosts exclude those two, except on /31 and /32 blocks.

The formula

Addresses = 2^(32 − prefix)Usable hosts = 2^(32 − prefix) − 2

Worked example

Using the default values shown in the calculator:

Octet 1192
Octet 2168
Octet 310
Octet 477
Prefix length (/n)26
  1. 192.168.10.77/26 has a block of 2^(32 − 26) = 64 addresses.
  2. The block containing .77 starts at 192.168.10.64 and ends at 192.168.10.127.
  3. Usable hosts: 192.168.10.65 to 192.168.10.126, which is 62 hosts. The mask is 255.255.255.192.

Result:

Network address192.168.10.64
Subnet mask255.255.255.192
Wildcard mask0.0.0.63
Broadcast address192.168.10.127
First usable host192.168.10.65
Last usable host192.168.10.126
Total addresses64
Usable hosts62

Frequently asked questions

What is the difference between the subnet mask and the wildcard mask?

The wildcard mask is the inverse of the subnet mask. Subnet masks have 1s in the network bits; wildcard masks have 1s in the host bits. Cisco ACLs use wildcard masks.

Why are two addresses unusable?

The first address names the network and the last is the broadcast address, so neither can be assigned to a normal host.

How do /31 and /32 work?

RFC 3021 allows a /31 for point-to-point links with two usable addresses. A /32 identifies a single host.

Sources and further reading

More in IP & Domain Tools · All calculators

This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.