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
Result
The working
Fill in the boxes above to see the answer and every step.
- In force from Checked on Source: RFC 1918 Address Allocation for Private Internets, RFC 6598 IANA-Reserved IPv4 Prefix for Shared Address Space, RFC 3927 Dynamic Configuration of IPv4 Link-Local Addresses, IANA IPv4 Special-Purpose Address Registry, RFC 3021 Using 31-Bit Prefixes on IPv4 Point-to-Point Links, RFC 5771 IANA Guidelines for IPv4 Multicast Address Assignments, IPv4 Multicast Address Space Registry
- In force from Checked on Source: RFC 4291 IP Version 6 Addressing Architecture, RFC 3849 IPv6 Address Prefix Reserved for Documentation, RFC 5952 A Recommendation for IPv6 Address Text Representation
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
Total a week of start and end times with unpaid breaks, overnight shifts and rounding. See hours as hh:mm and decimal, plus overtime over the weekly limit.
Find the days between two datesFind the gap between two dates in days, weeks, and years, months and days. Skip your own holidays for working days and choose to count the end date or not.
Check an exact ageFind your exact age in years, months and days today or on any cut-off date. Shows the month-end rule, the leap-day choice and your next birthday.
Results follow the rules shown above and are for guidance. For formal use, check them against your form, contract or the official source.