Skip to content
helpyself

Subnet Calculator

Local only — nothing is uploaded unless you save or share it.

A subnet calculator that gets /31 and /32 right, which most do not.

  1. Type an address with a prefix, like 192.168.1.10/24.
  2. Or give an address and a dotted mask, like 10.0.0.1 255.0.0.0.
  3. Read the network, the host range and the counts.
 
Network
Broadcast
Usable range
Usable hosts
Total addresses
Subnet mask
Wildcard mask
Scope
Class
Save this tool

Keep Subnet Calculator handy

Bookmark it

About this tool

An IPv4 subnet calculator: give it an address with a prefix, or an address and a dotted mask, and it works out the network address, the broadcast address, the first and last usable host, the total and usable host counts, the wildcard mask and whether the range is private or public. The reason to use this one is what it does with /31 and /32. The usual rule — take the size of the block and subtract two, for the network and broadcast addresses — is right from /0 down to /30 and wrong for the last two. A /31 has no broadcast address to reserve, because RFC 3021 defines it for point-to-point links where there is nothing to broadcast to, so both of its addresses are usable. A /32 is a single host: one address, one usable. Calculators that apply the subtraction blindly report zero usable hosts for a /31 and minus one for a /32, and both of those prefixes are in production on every router in the world. It refuses things rather than guessing at them. A mask has to be a run of ones followed by a run of zeros, so 255.255.0.255 is rejected instead of being rounded into something plausible. An octet with a leading zero is rejected too — 192.168.010.1 means different hosts to different resolvers, and a calculator should not be the thing that quietly normalises it. Everything runs in your browser. Nothing about your network is uploaded.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 holds 256 addresses, and two of them are spoken for: the first is the network address, which names the block, and the last is the broadcast address, which reaches everything in it. That leaves 254 for machines — which is where the familiar “subtract two” rule comes from, and it is correct everywhere except the two smallest prefixes.

Why does a /31 have two usable hosts?

Because there is nothing to broadcast to. RFC 3021 defines /31 for point-to-point links — two routers and a wire — where a broadcast address serves no purpose, so neither of the two addresses is reserved and both are usable. Calculators that subtract two regardless report zero, which would make a widely deployed configuration impossible.

What about a /32?

One address, and it is usable: a /32 is a single host. It is how a loopback interface, a host route or a firewall rule for one machine is written. The blind subtraction gives minus one, which is not a number of hosts anything can have.

What is a wildcard mask?

The subnet mask with every bit flipped — 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF want it that way round, where a zero means “this bit must match”. It is shown here because it is the number most often typed in by hand from a mask, and inverting four octets in your head is exactly the sort of thing that goes wrong at two in the morning.

Is 172.20.0.0 a private address?

Yes. The private range is 172.16.0.0 to 172.31.255.255 — a /12, not the /16 people often assume — so 172.20 is private and 172.32 is not. It is the least memorable of the three RFC 1918 ranges and the one most often got wrong, which is why the scope is printed rather than left to you.

Does it do IPv6?

Not yet — this is IPv4 only. IPv6 subnetting is a different shape of problem: the addresses are 128 bits, so the host counts stop being numbers anybody can read, and the useful output is prefix arithmetic rather than a first-and-last host range.

Help improve this tool

Found a bug, want a change, or need a tool we don't have?

/subnet-calculator

↑↓ to move · Enter to open · Esc to close