Subnet calculator
Enter a network in CIDR notation, an address with a netmask or an IPv6 prefix. The calculator shows the network, mask, first and last host address, broadcast and number of addresses.
Result: 192.168.1.0/24
- Network
- 192.168.1.0
- Prefix length
- /24
- Netmask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- Broadcast
- 192.168.1.255
- First usable address
- 192.168.1.1
- Last usable address
- 192.168.1.254
- Number of addresses
- 256
- Usable host addresses
- 254
- Address type
- Private (RFC 1918)
- Class (historical)
- C
- Reverse DNS zone
- 1.168.192.in-addr.arpa
- Binary (network)
- 11000000.10101000.00000001.00000000
- Binary (netmask)
- 11111111.11111111.11111111.00000000
Split into /25
| Network | First usable address | Last usable address |
|---|---|---|
| 192.168.1.0/25 | 192.168.1.1 | 192.168.1.126 |
| 192.168.1.128/25 | 192.168.1.129 | 192.168.1.254 |
Split into /26
| Network | First usable address | Last usable address |
|---|---|---|
| 192.168.1.0/26 | 192.168.1.1 | 192.168.1.62 |
| 192.168.1.64/26 | 192.168.1.65 | 192.168.1.126 |
| 192.168.1.128/26 | 192.168.1.129 | 192.168.1.190 |
| 192.168.1.192/26 | 192.168.1.193 | 192.168.1.254 |
What is a subnet?
A subnet is a block of contiguous IP addresses that belong to the same local network. Machines in the same subnet talk to each other directly, while traffic to other subnets goes through a router – often called the gateway or default gateway.
The size of a subnet is set by the prefix length, written after the slash in CIDR notation. 192.168.1.0/24 means the first 24 bits of the address are the network part and the last 8 bits the host part. With 8 host bits the network has 2⁸ = 256 addresses.
Netmask, wildcard and prefix
The netmask is the same as the prefix length written as an IP address: 24 ones followed by 8 zeros becomes 255.255.255.0. The wildcard mask is the inverse (0.0.0.255) and is used in access lists on Cisco equipment and in OSPF, among others.
| Notation | Example | Used in |
|---|---|---|
| CIDR | 10.20.0.0/22 | Documentation, routing, most modern tools |
| Netmask | 255.255.252.0 | Network adapters, DHCP, older equipment |
| Wildcard | 0.0.3.255 | ACLs and OSPF on Cisco and similar |
Network address, broadcast and usable hosts
In IPv4 the first address in a subnet is the network address and the last is the broadcast address. Neither can be used by a machine, so a /24 has 254 usable addresses, from .1 to .254. It is common practice to give the router the first usable address (.1).
Two exceptions: a /31 has two addresses that can both be used, and is the standard for point-to-point links between routers (RFC 3021). A /32 is a single address, typically a loopback or a host route.
How do I calculate a subnet by hand?
- Find the block size: 2^(32 − prefix). For a /26 that is 2⁶ = 64.
- Networks start at whole multiples of the block size in the octet where the prefix ends:
.0,.64,.128,.192. - The address
192.168.10.77/26falls in the block starting at.64. Network:192.168.10.64, broadcast:192.168.10.127. - Usable hosts are everything in between:
.65to.126– 62 addresses.
Private addresses
Internally most networks use private addresses from RFC 1918: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These are not routed on the internet and can be used freely. Consider a less common range than 192.168.0.0/24 and 192.168.1.0/24 – that avoids clashes when staff connect over VPN from home. Read more in the network segmentation guide.
IPv6
The calculator accepts IPv6 prefixes too. IPv6 has no broadcast, and a normal LAN is always a /64. To split a /48 or /56 into /64s, use the IPv6 subnet calculator.
IPv4 prefix reference
Every prefix length from /8 to /32 with netmask, wildcard and number of addresses. Usable hosts are two fewer than addresses, because the network and broadcast addresses cannot be assigned to a machine – except /31 (point-to-point, RFC 3021) and /32 (a single host).
| Prefix | Netmask | Wildcard | Addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Get your IP addresses under control today
Free for up to 100 IP addresses. Sign-in details by email immediately, no credit card.