Calculator and Converter

Subnet calculator

Enter an IPv4 address and a prefix length, and this tool works out the network details.

Results

Enter your values to see the result.

About this tool

It shows the network address in CIDR form, the subnet mask, the wildcard mask, the first and last usable addresses, the broadcast address and the number of addresses and usable hosts. You can also split the block into smaller subnets.

How it is calculated
the mask has "prefix" ones followed by zeros; network address = address AND mask; broadcast = network OR (NOT mask); addresses in the block = 2^(32 − prefix); usable hosts = that − 2 (a /31 has 2 usable addresses, RFC 3021, and a /32 has 1). IPv4 only.
Worked example
With IPv4 address: 192.168.1.37; Prefix length (the number after the slash): 24; Split into smaller subnets with prefix (0 to skip): 0, the result is: Network address: 192.168.1.0; Network in CIDR form: 192.168.1.0/24; Subnet mask: 255.255.255.0; Wildcard mask: 0.0.0.255; First usable address: 192.168.1.1; Last usable address: 192.168.1.254; Broadcast address: 192.168.1.255; Addresses in the block: 256; Usable hosts: 254.
Good to know
The mask has as many ones as the prefix length, the network address is the address combined with the mask, and the broadcast address is the network with all host bits set. The block holds 2 to the power of 32 minus the prefix addresses, and two are not usable for hosts, except in a /31 or /32. This tool is for IPv4 only.

Frequently asked questions

What does /24 mean?

It means the first 24 bits of the address identify the network. That leaves 8 bits for hosts, which gives 256 addresses and 254 usable ones.

What is a wildcard mask?

It is the opposite of the subnet mask. Some router and firewall rules use it to say which bits of an address may vary.

Why are two addresses not usable?

The first address names the network and the last is the broadcast address, so neither can be given to a device in an ordinary subnet.

Related calculators