Home · Everyday · Tech, Text & Media · IP Subnet Calculator
IP Subnet Calculator
Subnet arithmetic for an IPv4 address and prefix: network, broadcast, mask, usable range and host count.
What this calculator does
Subnet arithmetic for an IPv4 address and prefix: network, broadcast, mask, usable range and host count. Where a measure is involved, US and metric units are both accepted — flip the unit toggle and the figures convert with the same definitions the formula uses. Every result on this page is computed from the formula stated below, with no hidden rounding steps.
The formula and method
The subnet is computed from the address and prefix length; the network address zeroes the host bits.
Usable hosts exclude the network and broadcast addresses (except /31 and /32 point-to-point cases).
IPv4 addresses are 32-bit numbers, which is what the converter shows.
Worked example
With the example inputs this page opens with (prefix length (cidr) 24), the result is 254 — usable host addresses. Usable = 2^(32 − prefix) − 2: the all-zeros host part names the network and the all-ones host part is the broadcast address.
Quick reference
| Prefix length (CIDR) | Usable host addresses |
|---|---|
| 12 | 1,048,574 |
| 19.2 | 8,190 |
| 24 | 254 |
| 30 | 2 |
| 25 | 126 |
| 26 | 62 |
Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.
Common questions
How does the IP Subnet Calculator work?
Subnet arithmetic for an IPv4 address and prefix: network, broadcast, mask, usable range and host count. IP · Prefix length → Subnet details. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.
What inputs does the IP Subnet Calculator need?
IP · Prefix length → Subnet details. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.
Is the IP Subnet Calculator free to use?
Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.