IPv4 and IPv6 subnet calculator for planning your addressing
Enter an address with a prefix or a mask to get the network address, broadcast, range, mask, wildcard and the range type under the RFCs. You can also split a block into smaller subnets and check whether an address belongs to it.
The network to work out
This is an example: the starting addresses are made up and come from ranges reserved for documentation (192.0.2.0/24 and 2001:db8::/32), so they belong to no real network. Enter your own and the result updates straight away.
Examples from documentation ranges
For example 192.0.2.10/24, 192.0.2.10 255.255.255.0 or 2001:db8::1/64. An address on its own counts as /32 or /128.
Does an address belong to this network
The address only, without a prefix.
192.0.2.77 belongs to 192.0.2.0/24.
Split into smaller subnets
From /25 to /32. The result is in the table below.
Bits of the entered address
24 network bits and 8 host bits.Network partHost part
Split the network into smaller subnets
Every subnet with its range and address count. Copy the list into a config or a spreadsheet.
/26 subnets: 4. Addresses in each: 64. Usable in each: 62.
| Subnet | First host | Last host | Broadcast | Hosts |
|---|---|---|---|---|
| 192.0.2.0/26 | First host192.0.2.1 | Last host192.0.2.62 | Broadcast192.0.2.63 | Hosts62 |
| 192.0.2.64/26 | First host192.0.2.65 | Last host192.0.2.126 | Broadcast192.0.2.127 | Hosts62 |
| 192.0.2.128/26 | First host192.0.2.129 | Last host192.0.2.190 | Broadcast192.0.2.191 | Hosts62 |
| 192.0.2.192/26 | First host192.0.2.193 | Last host192.0.2.254 | Broadcast192.0.2.255 | Hosts62 |
Prefixes and masks side by side
Common prefix lengths for the family of the entered address. Your prefix is marked.
| Prefix | Mask | Wildcard | Addresses | Hosts |
|---|---|---|---|---|
| /8 | Mask255.0.0.0 | Wildcard0.255.255.255 | Addresses16,777,216 | Hosts16,777,214 |
| /16 | Mask255.255.0.0 | Wildcard0.0.255.255 | Addresses65,536 | Hosts65,534 |
| /20 | Mask255.255.240.0 | Wildcard0.0.15.255 | Addresses4,096 | Hosts4,094 |
| /22 | Mask255.255.252.0 | Wildcard0.0.3.255 | Addresses1,024 | Hosts1,022 |
| /23 | Mask255.255.254.0 | Wildcard0.0.1.255 | Addresses512 | Hosts510 |
| /24Your prefix | Mask255.255.255.0 | Wildcard0.0.0.255 | Addresses256 | Hosts254 |
| /25 | Mask255.255.255.128 | Wildcard0.0.0.127 | Addresses128 | Hosts126 |
| /26 | Mask255.255.255.192 | Wildcard0.0.0.63 | Addresses64 | Hosts62 |
| /27 | Mask255.255.255.224 | Wildcard0.0.0.31 | Addresses32 | Hosts30 |
| /28 | Mask255.255.255.240 | Wildcard0.0.0.15 | Addresses16 | Hosts14 |
| /29 | Mask255.255.255.248 | Wildcard0.0.0.7 | Addresses8 | Hosts6 |
| /30 | Mask255.255.255.252 | Wildcard0.0.0.3 | Addresses4 | Hosts2 |
| /31 | Mask255.255.255.254 | Wildcard0.0.0.1 | Addresses2 | Hosts2 |
| /32 | Mask255.255.255.255 | Wildcard0.0.0.0 | Addresses1 | Hosts1 |
Special-purpose ranges under IANA and the RFCs
What each block is for and whether it is reachable from the internet. The rows your network touches are marked.
| Range | Purpose | Source | Globally reachable |
|---|---|---|---|
| 10.0.0.0/8 | PurposePrivate use | SourceRFC 1918 | Globally reachableNo |
| 100.64.0.0/10 | PurposeShared address space for CGNAT | SourceRFC 6598 | Globally reachableNo |
| 127.0.0.0/8 | PurposeLoopback | SourceRFC 1122, 3.2.1.3 | Globally reachableNo |
| 169.254.0.0/16 | PurposeLink-local | SourceRFC 3927 | Globally reachableNo |
| 172.16.0.0/12 | PurposePrivate use | SourceRFC 1918 | Globally reachableNo |
| 192.0.2.0/24Your network | PurposeDocumentation | SourceRFC 5737 | Globally reachableNo |
| 192.168.0.0/16 | PurposePrivate use | SourceRFC 1918 | Globally reachableNo |
| 198.18.0.0/15 | PurposeBenchmarking | SourceRFC 2544 | Globally reachableNo |
| 198.51.100.0/24 | PurposeDocumentation | SourceRFC 5737 | Globally reachableNo |
| 203.0.113.0/24 | PurposeDocumentation | SourceRFC 5737 | Globally reachableNo |
| 224.0.0.0/4 | PurposeMulticast | SourceRFC 5771 | Globally reachableDepends on the block |
| 240.0.0.0/4 | PurposeReserved | SourceRFC 1112, 4 | Globally reachableNo |
The "Globally reachable" column comes from the IANA special-purpose registries. We added multicast (224.0.0.0/4, ff00::/8) and global unicast (2000::/3) from RFC 5771, RFC 4291 and the IPv6 address space registry, because those registries do not cover them.
Where these addresses come from
The six rules behind the calculator. Work them out by hand in binary and you will get the same result.
- Network address
address AND mask - Clear the host bits. 192.0.2.10/24 gives 192.0.2.0.
- Broadcast
network address OR wildcard - Set all the host bits. For 192.0.2.0/24 that is 192.0.2.255. A /31, a /32 and all of IPv6 have no broadcast.
- Wildcard
NOT mask - The mask with its bits inverted: 255.255.255.0 gives 0.0.0.255. Use this form in rules that ask for it.
- Address count
2^(address bits - prefix) - A /24 in IPv4 is 2^8, or 256 addresses, and 254 for hosts, because the network address and broadcast drop out. A /64 in IPv6 is 2^64.
- IPv6 notation
lowercase, no leading zeros, :: once - We show the RFC 5952 form: :: replaces the longest run of zero groups, the first one on a tie, and never a single group. We accept any valid RFC 4291 form.
- Range type
longest match in the IANA registry - The address 192.0.0.8 sits in 192.0.0.0/24, but the result uses the narrower 192.0.0.8/32 entry. It goes by the entered address, and a separate note tells you when the network reaches beyond that range.
What the calculator does not check
- Whether an address is allocated and announced in BGP
- Conflicts with addresses already in use on your network
- Classes A, B and C: addressing is classless (RFC 4632)
- Reserved interface identifiers in IPv6
Questions about the subnet calculator
Edge-case prefixes, notation and what happens to the addresses you enter.
A /30 has four addresses and two of them are usable, because the network address and broadcast drop out. A /31 has two addresses and both work, but only on a point-to-point link, as RFC 3021 describes. You save two addresses on every link.
RFC 4291 does not define one: multicast addresses do the job broadcast does in IPv4. That is why the calculator shows the first and last address of an IPv6 block rather than hosts.
After the address, add a space or a slash and the mask, for example 192.0.2.10 255.255.255.0. The calculator turns it into a prefix. If you enter a wildcard such as 0.0.0.255, it tells you which prefix that matches.
Classes went out of use with CIDR, described in RFC 4632. The prefix sets the network boundary rather than the first octet, so a class says nothing today about how large a network is.
The 100.64.0.0/10 block from RFC 6598 is meant for operators running CGNAT, and the RFC 1918 blocks are meant for internal networks. That way addresses on the operator side do not collide with the ones a customer uses at home or in an office.
It is the Globally Reachable column from the IANA registry. It says whether a block is meant to work beyond the local network. It does not say whether a given address is announced in BGP today, which the calculator does not check.
These blocks are reserved for documentation in RFC 5737 and RFC 3849, so an example never points at someone's real network. Do not use them in production.
No. Your browser does all the work. The data is stored in the page address after the # sign, and browsers do not send that part to the server, so it is not in our logs. Anyone who gets the link sees what you entered.
Sell addresses and prefixes where you already run your customers
In Flaem, IPv4 and IPv6 leasing, transit and BGP sessions work like any other service in your store. 14-day trial with every feature.