IP Subnet Calculator
Last updated: June 2026 · Free · No sign-up required
Enter values above and click Calculate to see your result instantly.
Quick reference
CIDR to mask and hosts:
| CIDR | Subnet mask | Usable hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /30 | 255.255.255.252 | 2 |
edit_note What you need
Have your numbers ready before you start. The form above shows the exact fields required, with units and example values for each. Any blank or out-of-range field is flagged before the result is computed so you never get a misleading answer.
function How it computes
The IP subnet calculator applies the published reference formula and rounds the result to a useful precision. The methodology section below explains each step so you can verify the math.
verified Trusted source
Reference values and constants come from an authoritative source. Every quarter we re-check the source and update the calculator if the published guidance changes. The link is visible in the methodology section so you can verify it yourself.
tips_and_updates Read it like this
Read the headline number first, then open the breakdown card to see how each input contributed. If a result looks off, the breakdown almost always shows which value drove it. Adjust that input and recalculate — the answer updates instantly.
Interpretation guide
Subnet terms:
| Term | Meaning |
|---|---|
| Network address | First address in the block |
| Broadcast address | Last address in the block |
| Usable hosts | Total minus network and broadcast |
| CIDR prefix | Number of network bits |
Formula & methodology
Formula: Total addresses = 2^(32 - prefix); usable hosts = total - 2 (network + broadcast)
The calculator takes an IPv4 address and CIDR prefix and returns the subnet mask, network and broadcast addresses, the usable host range, and host count. The prefix is the number of network bits; the remaining bits address hosts, so total addresses equal 2^(32 - prefix). Two addresses are reserved (network and broadcast), leaving the usable count. This is essential for planning networks and sizing subnets.