I built this to make it easier to size an IPv4 block, check its range, and copy the result for a ticket or plan. The arithmetic runs on your machine, it is IPv4 only for now, and the address you enter is never sent anywhere.
What the numbers mean
The part after the slash is the prefix length: how many leading bits of the address are fixed as network bits. The remaining bits are host bits. In 192.0.2.130/26 the first 26 bits are fixed, so the block holds 64 addresses, starting at 192.0.2.128. The notation is defined in RFC 4632.
The subnet mask is the same thing written in dotted decimal: /26 is 255.255.255.192. The wildcard mask is its bitwise opposite, 0.0.0.63. Wildcard masks are what access lists and some routing statements use when they need to match a range, so it is worth having both in front of you.
Clearing the host bits gives the network address, which is how a block is named: 192.0.2.128. Setting every host bit gives the broadcast address, 192.0.2.191, which addresses every host in the block at once. Neither of those two addresses is normally assigned to a device, which is why a block of 64 addresses conventionally holds 62 hosts. If you enter an address that is not the network address, the calculator clears the host bits to show the block it belongs to and keeps your original address in the report. You do not have to enter the network address.
Point-to-point links and single addresses
RFC 3021 allows a 31-bit prefix on point-to-point links. A /31 has two addresses, both usable as endpoints, and no directed broadcast, so the usual "total minus two" rule does not apply. A /32 is a single host route or a single address: one address, and no subnet directed broadcast either.
What the arithmetic does not tell you
- The conventional usable count applies to prefixes from /0 to /30: total addresses minus the network address and the broadcast address. It does not account for reserved and special-use addresses, for a gateway, for DHCP pools, or for how a particular device or platform treats a range. A block that reads as 62 usable hosts does not mean 62 addresses are available to you.
- A /31 and a /32 are the exceptions, and the report says so in its own words each time. A /31 reserves neither endpoint as a network address or a directed broadcast address, and RFC 3021 allows both of its addresses to be used as endpoints on a point-to-point link. A /32 is a single address or host route, with nothing to subtract.
- A prefix of 0 matches the whole IPv4 address space, 4294967296 addresses. That is a mathematical capacity, and it is not a plan.
- This is IPv4 only. IPv6 is not handled here.
- This calculator does not check whether an address is assigned to anyone, whether it is routable, or whether it is available for use. It reports the arithmetic of the prefix you give it, and nothing about ownership, registration or policy.
- This calculator does not assign addresses, change a network, or talk to any device. It is arithmetic, and it stays in your browser.
Primary sources: RFC 4632, Classless Inter-domain Routing and RFC 3021, Using 31-Bit Prefixes on IPv4 Point-to-Point Links.