Enter an IPv4 address and a prefix length — or a dotted subnet mask, whichever your equipment gave you — and get the network address, broadcast address, mask, wildcard mask, first and last usable host, and the host counts. It also handles the two cases that a surprising number of calculators get wrong. A /31 has two usable addresses under RFC 3021, not zero: the standard removes the network and broadcast reservation precisely so point-to-point links do not waste half a block, and /31 links are ordinary practice between routers. A /32 has one usable address, not minus one. Anything that blindly subtracts two from the total reports both incorrectly, and you will meet both on real infrastructure. Private and reserved ranges are matched by actual masking, so 172.32.0.1 is correctly public. Everything is computed in your browser.
| Prefix | Mask | Total | Usable |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 — RFC 3021 |
| /32 | 255.255.255.255 | 1 | 1 |
Because RFC 3021 says two. The standard removes the network and broadcast reservation for /31 specifically, so point-to-point links do not waste half a block on overhead. Calculators that always subtract two from the total report zero, which would make a perfectly standard router-to-router link look unusable.
One usable address — it describes a single host, so there is no network or broadcast address to reserve. Subtracting two gives minus one, which is obviously wrong but is what a naive formula produces.
Yes. Put either in the prefix field — 24 or 255.255.255.0 both work. A mask whose one-bits are not contiguous, such as 255.0.255.0, is rejected with that reason, since it is meaningless rather than merely unusual.
It is the inverse of the subnet mask, and Cisco access control lists use it instead. For a /24 the subnet mask is 255.255.255.0 and the wildcard is 0.0.0.255.
The first address in a normal subnet identifies the network itself and the last is the broadcast address, so neither can be assigned to a host. That rule is exactly what /31 and /32 suspend.
No. It is all arithmetic, done in your browser, with no lookups.
The address is converted to a 32-bit unsigned integer and masked, which is the whole of subnetting once the arithmetic is right — and the arithmetic has one trap worth naming. JavaScript's bitwise operators work on signed 32-bit integers, so shifting an address whose top bit is set produces a negative number, and anything from 128.0.0.0 upward comes out wrong unless every result is coerced back to unsigned. Two prefix lengths then break the ordinary rules, and this is where most calculators are simply incorrect. A /32 describes a single address: there is no network address and no broadcast address to reserve, so it holds one usable host. A /31 holds two addresses and RFC 3021 makes both of them usable, because the standard exists specifically to remove the network and broadcast reservation for point-to-point links, where dedicating half a four-address block to overhead was wasteful. Calculators that unconditionally subtract two from the total report zero usable hosts for a /31 and minus one for a /32, which is not merely cosmetic — a /31 is standard practice on router-to-router links, so the wrong answer appears on real infrastructure. Both cases are handled explicitly here and explained on screen. The prefix field accepts either a length or a dotted subnet mask, since people have whichever their equipment showed them, and a mask whose one-bits are not contiguous is rejected with that reason rather than silently producing nonsense. Private ranges are matched by masking rather than by string prefix, so 172.32.0.1 is correctly reported as public where a naive check on 172.16 through 172.31 written as text gets it wrong. Everything is computed in your browser.