IP Subnet Calculator — network, broadcast & host range from any IP
An IP subnet calculator starts from a single IP address and a mask or prefix and works backwards to the subnet that address belongs to — its network and broadcast address, the address immediately before and after it, and every other subnet of the same size nearby.
IP address to subnet
Enter any IP address and a prefix length to find the subnet it falls inside.
| Subnet (network/prefix) | 10.24.7.0/24 | |
| Position in subnet | Host #130 of 256 addresses in this subnet | |
| Usable range | 10.24.7.1 – 10.24.7.254 (254 usable) | |
| Previous address | 10.24.7.129 | |
| Next address | 10.24.7.131 | |
| Typical gateway | 10.24.7.1 (common convention — the actual gateway is whatever the network is configured to use) |
| Subnet | |
|---|---|
| 10.24.7.0/24 | ← contains 10.24.7.130 |
Showing the first 20 of 256 /24 subnets inside 10.24.0.0/16.
IP address to subnet: worked example
Take 10.24.7.130 with a /24 mask. A /24 fixes the first three octets, so the network address is 10.24.7.0 and the broadcast address is 10.24.7.255. The address 10.24.7.130 is the 130th address counting from the network address, well inside the usable range of 10.24.7.1–10.24.7.254 — so this host can be assigned that address safely, as long as nothing else on the same subnet is already using it.
Private vs public ranges (RFC 1918)
Three address blocks are reserved for private networks and are never routed on the public internet.
| Range | CIDR | Addresses |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 |
Source: RFC 1918, “Address Allocation for Private Internets” (checked 25 Oct 2026). Anything outside these three blocks (and a few other reserved ranges like 127.0.0.0/8 for loopback) is considered a public address.
IP classes A–E
The original (1981) classful system — mostly historical today, since CIDR replaced fixed class boundaries, but the terms are still common.
| Class | First octet | Default mask | Typical use |
|---|---|---|---|
| A | 0–127 | /8 | Very large networks (also contains 127.0.0.0/8, loopback) |
| B | 128–191 | /16 | Medium-to-large networks |
| C | 192–223 | /24 | Small networks — most private LANs |
| D | 224–239 | — | Multicast, not assigned to hosts |
| E | 240–255 | — | Reserved for future/experimental use |
Source: RFC 791, “Internet Protocol” (checked 25 Oct 2026).
Frequently asked questions
How do I know which subnet an IP belongs to?
Apply a bitwise AND between the IP address and the subnet mask — the result is the network address of the subnet that IP belongs to. This calculator does that automatically once you enter the IP and prefix.
Is the gateway always the first usable address?
Not always, but it’s a very common convention (the first usable address, right after the network address) — some networks use the last usable address instead. There is no technical requirement either way; check your own network’s configuration.
What’s the difference between this and the main Subnet Calculator?
They share the same underlying math. This page starts from a single address you’re troubleshooting and shows its place within the wider /16, which is handy when you’re looking at one device’s IP and need to work out its network.
This calculator is part of SeaMeWe4 Net Tools, an independent set of free networking calculators.
Was this page helpful?
One tap tells us which guides need more detail.
Thanks for your feedback!