Skip to the calculator
Rule Calculator

Subnet calculator

Network, broadcast, mask, wildcard and usable range for any IPv4 prefix — with the address and the mask stacked in binary underneath, so the boundary is something you can see rather than a number you have to trust.

By Alex Seote, Built and maintains Rule Calculator

Behaviour checked against the RFCs · How we check

Network

192.168.1.128/26

Network address192.168.1.128
Usable range192.168.1.129 – 192.168.1.190
Broadcast address192.168.1.191
Subnet mask255.255.255.192
Wildcard mask0.0.0.63
Addresses in the block64
Usable for hosts62

This block is inside reserved space — Private use, RFC 1918. It will not route on the public internet.

The working, in binary

The network is the address with every host bit cleared. Stack the three and the boundary is visible: everything left of it belongs to the network, everything right of it is a host.

Address11000000.10101000.00000001.10000010
Mask11111111.11111111.11111111.11000000
Network11000000.10101000.00000001.10000000

26 network bits, 6 host bits.

The two rows most calculators get wrong

A subnet of 2ⁿ addresses normally loses two: the all-zeroes address names the network and the all-ones address is the broadcast. Applied blindly, that rule says a /31 holds two addresses and none of them is usable, which would make the prefix pointless — and it is not pointless, it is what point-to-point links between routers are numbered with. RFC 3021 removed both reservations for that case, because a link with exactly two ends already knows who the other end is.

A /32 is the other edge: one address, no block, no broadcast. It is a host route, and it is how a loopback interface or a single advertised address is written.

Questions people actually ask

Why does a /31 have two usable addresses and not zero?
Because a link with exactly two ends has nobody to broadcast to. The "subtract two" rule sets aside a network address and a broadcast address, and on a point-to-point link neither is needed — RFC 3021 says so explicitly and routers have implemented it since 2000. A calculator that reports zero has applied a rule past the case it was written for, which is the single commonest error in this category.
What is a wildcard mask?
The subnet mask with every bit flipped: where the mask has 1 the wildcard has 0. Cisco access lists and OSPF network statements take the wildcard rather than the mask, so 255.255.255.0 becomes 0.0.0.255. It carries no extra information — it is the same boundary written the other way round.
Why does /26 split at .64 and .128 rather than somewhere round?
Because the boundary is a number of bits, not a number of decimal addresses. A /26 leaves six host bits, which is 64 addresses, so the blocks start at .0, .64, .128 and .192. The binary table above shows the split: two bits into the last octet, and everything to the right of them is host.
Which addresses will not route on the internet?
The RFC 1918 blocks — 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 — plus loopback at 127.0.0.0/8, link-local at 169.254.0.0/16 and carrier-grade NAT at 100.64.0.0/10. This page names the block when the network falls inside one, because "why can nobody reach this host" usually has that answer.
Is the network address really unusable?
By convention rather than by physics, on anything larger than a /31. The all-zeroes host address names the network itself and the all-ones address is the directed broadcast, and while some stacks will let you assign them, doing it breaks tools that assume otherwise. The count above follows the convention.

Sources

Related