How the calculator derives a subnet
Every IPv4 subnet is defined by two 32-bit values: the address and the mask. The prefix length (/26) is just the count of leading 1-bits in the mask. The calculator runs three bitwise operations:
broadcast = network OR (NOT mask)
usable hosts = 2(32 − prefix) − 2
The first and last host are simply network + 1 and broadcast − 1. Two edge cases follow the RFCs: a /31 has two usable addresses and no broadcast (RFC 3021, point-to-point links), and a /32 is a single host route, typical for loopbacks and router IDs.
Worked example: 192.168.1.130/26
A /26 leaves 6 host bits, so each block is 26 = 64 addresses and the mask is 255.255.255.192. Only the fourth octet is interesting:
130 = 10000010 192 = 11000000 AND = 10000000 = 128
| Field | Value |
|---|---|
| Network | 192.168.1.128/26 |
| First host | 192.168.1.129 |
| Last host | 192.168.1.190 |
| Broadcast | 192.168.1.191 |
| Usable hosts | 62 |
| Wildcard | 0.0.0.63 |
The fast mental method: block size = 256 − interesting mask octet (256 − 192 = 64). Subnets start at multiples of 64 (0, 64, 128, 192); 130 falls in the block that starts at 128.
Applying it on real gear
Once you have the values, the configuration is mechanical. Most platforms accept prefix notation; classic IOS still wants the dotted mask:
! Cisco IOS / IOS XE interface GigabitEthernet0/1 ip address 192.168.1.129 255.255.255.192 # Juniper Junos set interfaces ge-0/0/1 unit 0 family inet address 192.168.1.129/26 # MikroTik RouterOS /ip address add address=192.168.1.129/26 interface=ether2 # Linux iproute2 ip addr add 192.168.1.129/26 dev eth1
Design tips
- Use the first usable address as the default gateway consistently across the site; it makes troubleshooting and documentation predictable.
- Size user VLANs with 30–50% headroom. Renumbering a live subnet costs far more than a few wasted addresses in RFC 1918 space.
- Keep 100.64.0.0/10 (RFC 6598, CGNAT) out of your internal plan if your ISP uses carrier-grade NAT; overlapping ranges break routing in subtle ways.
- Align subnets on boundaries that summarize cleanly per site or per building, so a single route can represent each location (RFC 4632).
The neighbor table under the result lists the adjacent subnets of the same size inside the next shorter prefix, which helps you see where a block sits and what is free around it.