Last updated
How to use the subnet calculator
- Type an IPv4 address with a prefix, such as 192.168.1.0/24, or pick the prefix or mask from the lists.
- Read the network address, broadcast address, subnet mask and wildcard mask.
- Check the first and last usable host and the number of usable hosts.
- Copy one value, copy the whole result, or print the page.
What each result means
A subnet breakdown lists the values below for one network.
- Network address
- The first address in the subnet. It names the subnet itself and is not given to a device.
- Broadcast address
- The last address in the subnet. A packet sent to it reaches every host in the subnet.
- Subnet mask
- A pattern of ones followed by zeros that marks the network part of an address. A /24 is 255.255.255.0.
- Wildcard mask
- The subnet mask turned inside out: ones become zeros and zeros become ones. A /24 gives 0.0.0.255. To convert a prefix or mask to a wildcard mask and back, use the wildcard mask calculator.
- First and last usable host
- The addresses between the network and broadcast addresses, which you can give to devices.
- Usable hosts
- The count of those addresses: the total minus 2, except /31 (2) and /32 (1).
- Address type
- What kind of address you typed, such as private, public, loopback or multicast.
Common subnet sizes
These seven sizes cover most small networks. For every prefix from /0 to /32, see the subnet mask cheat sheet.
| Prefix | Subnet mask | Total addresses | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
Subnet mask and CIDR notation
A /24 is 255.255.255.0: the number after the slash counts the one bits at the start of the mask. To see the first address, last address and size of any block, use the CIDR calculator.
Private, public and special addresses
The Address type row describes the address you typed, not the whole block. The three private blocks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). The first matching row below is used.
| Block | Address type |
|---|---|
| 10.0.0.0/8 | Private (RFC 1918) |
| 172.16.0.0/12 | Private (RFC 1918) |
| 192.168.0.0/16 | Private (RFC 1918) |
| 100.64.0.0/10 | Shared / CGNAT (RFC 6598) |
| 127.0.0.0/8 | Loopback |
| 169.254.0.0/16 | Link-local |
| 0.0.0.0/8 | "This network" (0.0.0.0/8) |
| 192.0.2.0/24 | Documentation (RFC 5737) |
| 198.51.100.0/24 | Documentation (RFC 5737) |
| 203.0.113.0/24 | Documentation (RFC 5737) |
| 224.0.0.0/4 | Multicast |
| 255.255.255.255/32 | Limited broadcast |
| 240.0.0.0/4 | Reserved (240.0.0.0/4) |
| Anything else | Public |
To test a single address, use the private IP address ranges checker.
Point-to-point links: /31 and /32
A /31 has two addresses and both are usable, so it suits a link between two devices. It has no network or broadcast address, and the Broadcast address row reads none (/31 point-to-point link). For example, 10.1.1.0/31 gives the hosts 10.1.1.0 and 10.1.1.1.
A /32 is a single address. It has 1 usable host and the Broadcast address row reads none (single host /32). For example, 10.1.1.5/32 is the one host 10.1.1.5.
Split a network into smaller subnets
A longer prefix cuts a network into smaller subnets. A 192.168.1.0/24 splits into two /25 networks, four /26 networks or eight /27 networks, and each one has its own network address and broadcast address.
Frequently asked questions
How do you calculate a subnet from an IP address and mask?
Write the address and mask in binary and AND them: the result is the network address. For 192.168.1.130/26 the network is 192.168.1.128, the broadcast is 192.168.1.191, and the usable hosts run from 192.168.1.129 to 192.168.1.190. The calculator above does the steps instantly and shows the binary view.
What is the difference between the network address and the broadcast address?
The network address is the first address in a subnet and names the subnet itself. The broadcast address is the last address and reaches every host in it. Neither is given to a device. In 192.168.1.0/24 they are 192.168.1.0 and 192.168.1.255, which leaves 254 usable hosts between them.
What happens if I enter a host address instead of a network address?
The calculator never rejects it. It clears the host bits and shows the network. Enter 192.168.1.130/26 and it tells you that you entered a host address and the network is 192.168.1.128/26, with 64 total addresses and 62 usable hosts. Enter 192.168.1.10/27 and the network is 192.168.1.0/27.
What is a /31 subnet used for?
A /31 is used for point-to-point links between two devices, as RFC 3021 allows. It has 2 addresses and both are usable, with no network or broadcast address. For example, 10.1.1.0/31 gives hosts 10.1.1.0 and 10.1.1.1. A /30 for the same job wastes two addresses: it has 4 addresses and only 2 usable hosts.
Can I type a subnet mask instead of a prefix length?
Yes. Type 192.168.1.10 255.255.255.224 or 192.168.1.10/255.255.255.224, or pick the mask from the list, and the prefix updates to /27. The result is 192.168.1.0/27 with 30 usable hosts. A mask that is not one run of ones followed by zeros, such as 255.0.255.0, is rejected with a message.
How can I tell if an address is private or public?
Read the Address type row, which describes the address you entered. For 192.168.1.0/24 it shows Private (RFC 1918), for 8.8.8.8/24 it shows Public, and for 0.0.0.0/0 it shows "This network". The three private blocks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. The private ranges page has a checker for any single address.