Rapid Age Calculator
What do you want to work out?

Subnet Calculator

Enter an IP address with its prefix length and the calculator returns the network address, broadcast address, subnet mask, wildcard mask, first and last usable host and the host count. A binary view shows how the mask splits the address, and a split table divides a block into smaller subnets. IPv6 prefixes are handled too.

Calculate a subnet

Fill in the boxes. The answer and the working update as you type.

IPv4 such as 192.168.1.0/24, or IPv6 such as 2001:db8::/48. An IPv4 address with a dotted mask, 192.168.1.0 255.255.255.0, also works.

A longer prefix than the one above. Leave blank to skip the split.

Result

Fill in the boxes above to see the answer and every step.

How the ranges are worked out

The steps of the worked example appear here.

The address and mask are read as thirty-two bit numbers. The network address is the address with all host bits set to zero, the broadcast address is the same address with all host bits set to one, and the usable hosts sit between them. The two-address point-to-point prefix is the exception, because both of its addresses are hosts, as RFC 3021 sets out. A single-host prefix is shown with one usable address, which is a convention rather than something the standard defines. An octet with a leading zero is rejected because some systems read it as octal. IPv6 has no broadcast address, because multicast replaces it. The private ranges from RFC 1918 are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, shared address space is 100.64.0.0/10, loopback is 127.0.0.0/8 and link-local is 169.254.0.0/16.

Worked example

For the sample block loaded by the Try an example button, the network address is 172.16.5.128 and the broadcast address is 172.16.5.191. The mask is 255.255.255.192, written in binary as 11111111.11111111.11111111.11000000, and the wildcard is 0.0.0.63. Usable hosts run from 172.16.5.129 to 172.16.5.190, which is 62 hosts out of 64 addresses.

Special and private ranges

The private ranges from RFC 1918 are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, shared address space is 100.64.0.0/10, loopback is 127.0.0.0/8 and link-local is 169.254.0.0/16.

The special-purpose ranges are listed from the registry as checked on the date shown, and the rule set is marked provisional, so confirm against the registry for anything critical.

Addresses in the private, shared, loopback and link-local ranges are labelled in the result, so you can tell at a glance whether an address is public.

Frequently asked questions

How to find subnet mask calculator?

Enter the address with its prefix length. The mask is the prefix written as four numbers: for the sample block it is 255.255.255.192, and the wildcard is its opposite, 0.0.0.63. The binary view shows a run of ones followed by a run of zeros, and the ones mark the network part.

How many hosts subnet calculator?

Usable hosts are the total addresses minus the network and broadcast addresses. In the sample block that is 64 addresses and 62 usable hosts. The two-address point-to-point prefix is an exception, because both addresses are hosts under RFC 3021.

Subnet calculator how to?

Type the address and prefix, read off the network, broadcast and host range, then enter a longer prefix to split the block into smaller subnets. Addresses in the private, shared, loopback and link-local ranges are labelled in the result, so you can tell at a glance whether an address is public.

What is subnet calculator?

A subnet calculator takes an address and a prefix and works out the network range for you: the network and broadcast addresses, the mask and the usable hosts. It also splits a block into smaller subnets, so you do not have to count in binary by hand.

Related calculators

Results follow the rules shown above and are for guidance. For formal use, check them against your form, contract or the official source.