24 network bits, 8 host bits. Click any bit to move the boundary.
Subnet Calculator
Type an address with a prefix and read off every number you need.
About the Subnet Calculator
What is a subnet calculator?
Subnetting is binary arithmetic wearing a decimal disguise. An address like 192.168.1.130 is really 32 bits, the prefix says how many of those bits name the network, and everything else follows from that one split. A calculator does the bit shifting so you can get on with the part that needs judgment, which is how big each segment should be.
We rebuilt this one in 2026 to cover the jobs that actually come up. It reads IPv4 and IPv6, takes a dotted mask or a Cisco wildcard as happily as a slash, splits a network into equal pieces, plans variable length subnets from a list of host counts, turns a start and end address into the fewest CIDR blocks, and summarizes a set of routes into one prefix. The bit strip near the top is not decoration either. Click any bit and the boundary moves there, which is the fastest way to see what a prefix change costs you.
How to Use This Tool
- Type an address.
192.168.1.10/24,192.168.1.10 255.255.255.0and192.168.1.10 0.0.0.255all work, and so does an IPv6 prefix like2001:db8::/48. - Drag the slider or click a bit in the strip to change the prefix. Everything below updates as you go.
- Split into subnets cuts the network into equal blocks at whatever new prefix you pick and lists each one.
- VLSM planner takes a host count per segment and hands out the smallest block that fits each, biggest first, so nothing is wasted.
- Range to CIDR turns two addresses into the fewest prefixes that cover exactly that range, which is what a firewall rule usually wants.
- Summarize routes collapses a list of networks into one prefix and tells you how much extra that prefix drags in.
- Copy the results, download them as CSV or JSON, or copy a link that reopens the same calculation.
Common Use Cases
Different jobs need different numbers out of the same address.
- Carving up an office network. Start with the block you were given and use the VLSM planner rather than guessing at equal halves.
- Writing firewall and ACL rules. Cisco access lists want the wildcard mask, which is right there in the results, and Range to CIDR handles the ranges that do not line up on a prefix.
- Cloud VPCs. AWS, Azure and GCP all reserve a handful of addresses in every subnet, so a /28 gives you fewer usable hosts than the 14 shown here. Plan a size up.
- Studying for a certification. The bit strip and the binary rows show what the mask is doing instead of just telling you the answer.
- Debugging a routing table. Summarize routes shows whether a set of prefixes can safely collapse into one advertisement.
- Moving to IPv6. Paste a /48 and split it to /64 to see how the site prefix divides up.
IPv4 subnet mask cheat sheet
The whole table, from a single host up to the entire address space. Usable hosts already has the network and broadcast addresses taken off, except for /31 and /32 where that rule does not apply.
| Prefix | Subnet mask | Wildcard | Total addresses | Usable hosts |
|---|---|---|---|---|
/32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
/31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
/30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
/29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
/28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
/27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
/26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
/25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
/24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
/23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
/22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
/21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
/20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
/19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
/18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
/17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
/16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
/15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
/14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
/13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
/12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
/11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
/10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
/9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
/8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
/7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 |
/6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 |
/5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 |
/4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 |
/3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 |
/2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 |
/1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 |
/0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 |
Frequently Asked Questions
How do I calculate the number of hosts in a subnet?
Take 2 to the power of the host bits, then subtract 2. The host bits are 32 minus the prefix, so a /26 has 6 host bits, 2 to the power of 6 is 64, and 64 minus 2 leaves 62 usable hosts. The two you lose are the network address at the bottom and the broadcast address at the top, neither of which can go on a device.
What is CIDR notation?
It is the slash and the number after an address, as in 192.168.1.0/24. The number counts how many bits from the left belong to the network, which makes it a shorter way of writing 255.255.255.0. CIDR replaced the old class A, B and C system in 1993 because classes only allowed splits at /8, /16 and /24, and that wasted enormous amounts of address space.
What is the difference between the network and broadcast address?
The network address is the first address in the block, with every host bit set to 0, and it names the subnet itself. The broadcast address is the last, with every host bit set to 1, and traffic sent there reaches every device on that subnet. Neither can be assigned to a device, which is why the usable range always starts one after the network address and ends one before the broadcast.
What is a wildcard mask and when do I need one?
It is the subnet mask with every bit flipped, so 255.255.255.0 becomes 0.0.0.255. Cisco access lists, route maps and OSPF network statements all want the wildcard rather than the mask. A 0 bit means the bit has to match and a 1 bit means ignore it, which is the opposite of how a subnet mask reads and the source of a lot of confusion.
What is VLSM and why not just split evenly?
Variable Length Subnet Masking means giving each segment a mask sized to what it needs instead of cutting everything into equal blocks. If one segment needs 50 hosts and three need 6 each, equal /27s burn most of a /24 for nothing, while a /26 plus three /29s leaves you plenty of room to spare. The planner here sorts by size before it allocates, which is what keeps the leftover space contiguous.
Why does a /31 have 2 usable hosts instead of 0?
Because RFC 3021 says so. On a point to point link there is nothing to broadcast to, so both addresses in a /31 are usable and the pair works fine between two router interfaces. It saves two addresses per link compared with the /30 that used to be standard, which adds up quickly across a large network.
Does an IPv6 subnet lose two addresses as well?
No. IPv6 has no broadcast address, so every address in a prefix is usable, and the anycast subnet router address is a convention rather than a reservation. In practice you almost always assign a /64 to a segment regardless of how many devices are on it, because stateless address autoconfiguration expects 64 interface bits.
Is anything I type sent to your server?
No. Every calculation runs in JavaScript in your browser, so the internal addressing plan you paste in never leaves your machine. If you want to know which address the internet sees you from, try What Is My IP Address.