SeaMeWe4 Net Tools Subnet calculator

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.

10.24.7.130 shown at position 130 of 256 addresses inside the 10.24.7.0/24 subnet

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 subnetHost #130 of 256 addresses in this subnet
Usable range10.24.7.1 – 10.24.7.254 (254 usable)
Previous address10.24.7.129
Next address10.24.7.131
Typical gateway10.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

Diagram of network bits versus host bits, the basis for finding which subnet an address belongs to

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.

RangeCIDRAddresses
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 – 192.168.255.255192.168.0.0/1665,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.

ClassFirst octetDefault maskTypical use
A0–127/8Very large networks (also contains 127.0.0.0/8, loopback)
B128–191/16Medium-to-large networks
C192–223/24Small networks — most private LANs
D224–239—Multicast, not assigned to hosts
E240–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.