Subnet Prefix Length Calculator for IPv4

June 30, 2026

Subnet Prefix Length Calculator

Plan an IPv4 subnet by host count, usable hosts, CIDR prefix, subnet mask, VLAN count, reserve percentage, network size, and a route summarization hint.

🗂Named Network Presets
⚙Subnet Inputs

Example: 192.168.20.0 or 10.40.0.0

CIDR Prefix
/24
255.255.255.0
Usable Hosts
254
per subnet
Network Size
256
addresses per VLAN
VLAN Plan
4
1024 total addresses
Network address and broadcast192.168.20.0 to 192.168.20.255
Host count with reserve48 hosts + 10% reserve = 53
Subnet mask and wildcard255.255.255.0 / 0.0.0.255
Usable host range192.168.20.1 to 192.168.20.254
VLAN allocation footprint4 VLANs use 1024 addresses
Route summarization hint192.168.20.0/22
Planning noteClean subnet boundary
Ready to calculate.
📊IPv4 Subnet Spec Grid
/30
2 usable hosts
/29
6 usable hosts
/28
14 usable hosts
/27
30 usable hosts
/26
62 usable hosts
/25
126 usable hosts
/24
254 usable hosts
/22
1022 usable hosts
🖧Prefix, Mask, and Host Reference
CIDRSubnet MaskTotal AddressesUsable HostsTypical Use
/32255.255.255.25511 host routeLoopback, single host, firewall object
/31255.255.255.25422 point-to-pointRFC 3021 router transit only
/30255.255.255.25242Legacy routed link
/29255.255.255.24886Small appliance segment
/28255.255.255.2401614Management or lab services
/27255.255.255.2243230Small client VLAN
/26255.255.255.1926462Office, camera, or IoT VLAN
/25255.255.255.128128126Large wireless or device VLAN
/24255.255.255.0256254Common home lab VLAN
/23255.255.254.0512510Dense client network
/22255.255.252.010241022Campus-style LAN block
/21255.255.248.020482046Multi-VLAN site reserve
📋VLAN Planning Examples
Network ProfileHost TargetRecommended PrefixUsable HostsReserve Fit
Management VLAN10 to 12 devices/2814Tight but tidy
Camera VLAN20 to 28 devices/2730Good for NVR growth
IoT VLAN35 to 55 devices/2662Good with 10% reserve
Guest WiFi60 to 110 leases/25126Short DHCP lease friendly
Main LAN120 to 220 clients/24254Simple operations
Lab aggregate300 to 500 nodes/23510Use with clear DHCP scopes
🌐Private IPv4 Blocks and Summary Boundaries
BlockCIDR RangeTotal AddressesGood FitPlanning Note
10.0.0.0/810.0.0.0 to 10.255.255.25516,777,216Large labs, many sitesEasy to summarize by site or rack
172.16.0.0/12172.16.0.0 to 172.31.255.2551,048,576Site blocksLess common at home, still private
192.168.0.0/16192.168.0.0 to 192.168.255.25565,536Home networksAvoid overlap with VPN peers
CGNAT note100.64.0.0/104,194,304Provider useNot RFC1918 for LAN planning
🧭Route Summary Sizing Table
Subnet Size2 VLANs4 VLANs8 VLANs16 VLANs
/28 each/27 summary/26 summary/25 summary/24 summary
/27 each/26 summary/25 summary/24 summary/23 summary
/26 each/25 summary/24 summary/23 summary/22 summary
/25 each/24 summary/23 summary/22 summary/21 summary
/24 each/23 summary/22 summary/21 summary/20 summary
💡Subnet Planning Tips
Leave room for DHCP churn. Wireless, guest, and IoT networks usually need more reserve than management or storage VLANs because devices reconnect, roam, and hold leases.
Summaries need contiguous blocks. A route summary is clean only when the child subnets are adjacent and aligned on the summary boundary.
This calculator uses standard IPv4 address arithmetic. Confirm final addressing in your router, firewall, DHCP server, and IPAM tool before changing a production network.

When you set up a home lab the first time, it’s like building a house blind. You’ve got some switches, a router, and some server you’ve put together that want to talk to each other, yet you don’t want them talking to your smart fridge. Usually, the frustration sets in when you run out of network addresses (or worse, when they bleed where they shouldn’t).

Everything changes once you begin thinking in terms of blocks instead of individual IPs. At that point, it stops being so messy and confusing, it becomes more about spatial planning for an invisible room, which is why subnetting is more about spatial planning different than math.

How to Plan Your Home Network Space

When most people first start out they will do a /24 subnet by default. This leaves you with 254 usable hosts. If you have twenty devices and never intend to go beyond that, that’s great. A /24 subnet falls apart the moment you want to segment traffic for security or performance without carving up your address space into tiny, unmanageable shards.

The calculator above lets you plug in your number of devices plus expected growth then does the math for you (as opposed to having to shift binary bits around in your head). It takes your physical hardware requirements and converts them into language of CIDR notation.

But what’s the right amount of space to keep blank? When creating new networks, it’s tempting to fill ‘em up; each phone gets its own IP, each server have its own IP address. But in reality, devices come and go, guests hop on the Wi-Fi and new projects get thrown onto the weekend backlog.

That’s where the reserve percentage comes in to account for churn. If you’re building out a VLAN for your IoT network, which includes forty cameras and smart bulbs, don’t plan to give them all the exact same number of IP addresses. Eventually, you’ll add another sensor and… whoops! The limit is reached. Now you gotta redesign half of your routing table.

Thirty percent headroom might seem like overkill but it saves you from a world of pain during painful sessions of changing IP addresses.

The tricky part is figuring out what length prefix to use; you want the prefix to be long enough that you have some breathing room, but not so long as it makes your route summary unwieldy. Using a longer prefix mean you can combine more smaller subnets into a single announced route, saving on memory in your router’s memory bank. However, there’s a caveat: the subnets need to be lined up correctly and contiguous. Randomly scattering around /29s and /28s in a larger subnet won’t allow you to combine them effectiveley.

The table on the page clearly explains how nicely four /28s pack into a /26 container. And that’s why anyone who want to build something beyond a flat topology of devices needs to care about how things align.

There’s also a special note on point-to-point links. These defy convention. If you’re connecting two firewalls with a point-to-point link you may be inclined to give them a whole /24. That’s incredibly wasteful! A /30 or even better, a /31 will save that precious space for real, customer-facing traffic.

It sounds trivial, but when your environment is dense and every address matters… it makes a difference. The tool helps separate those infrastructure requirements from your other, user facing VLANs. It prevents you from over-allocating enterprise level addresses to just one router hop away.

Home users know and love their private IP address ranges such as 192.168.0.0/16. However, running remote access tunnels, VPNs etc. This can lead to clashes. When configuring these services, it’s easy to accidental overlap with publicly accessible traffic on the Internet. Sticking to a solid plan in that space avoids this.

This is about defining boundaries so that internal systems remains protected, yet also enable controlled communication. In the end, good subnetting is all about planning for the future, reserving space for the unknown. That’s why you’ll never use all of the IP addresses you reserved. And that’s fine. It is supposed to be there as a buffer against complexity. This acts as an expansion buffer that allows you to grow now without pulling down something that already works today.

Begin with clear boundaries. Honor the binary nature of the prefixes. Trust the calculator to do the math. This allows you to worry less about arithmetic and more about how things connect.

Subnet Prefix Length Calculator for IPv4

Related posts

Leave a Comment