Network Diagnostics

Subnet Calculator

Enter an IPv4 address and a CIDR prefix to get the network address, broadcast address, subnet mask and the full range of usable host addresses.

What the CIDR prefix means

An IPv4 address is 32 bits long. The prefix after the slash says how many of those bits identify the network; everything left over identifies individual hosts on it. In 192.168.1.10/24, the first 24 bits are the network, leaving 8 bits for hosts.

That single number determines everything else. Eight host bits give 28 = 256 addresses, of which 254 are usable. Every step down the prefix doubles the size of the block: a /23 is two /24s joined together, a /22 is four.

The five values this calculator returns

  • Network address — the first address in the block, which names the network itself. It is never assigned to a device.
  • Broadcast address — the last address, reserved for traffic sent to every host at once. Also never assigned.
  • Subnet mask — the same information as the prefix, written in dotted-decimal form. /24 and 255.255.255.0 mean exactly the same thing.
  • Usable host range — everything between those two reserved addresses. This is what you can hand out.
  • Total usable hosts — the count of that range, which is why a /24 gives you 254 rather than 256.

Common prefixes at a glance

PrefixSubnet maskUsable hostsTypically used for
/30255.255.255.2522Point-to-point links between routers
/29255.255.255.2486A small block of static server IPs
/28255.255.255.24014A rack or a small office segment
/24255.255.255.0254The standard home or office LAN
/22255.255.252.01,022A larger campus network
/16255.255.0.065,534A large private address space

Two special cases

A /31 has no room for separate network and broadcast addresses, so both of its two addresses are usable. This is deliberate and standard practice on router-to-router links, where reserving two of four addresses would be wasteful.

A /32 describes exactly one address. You'll see it in firewall rules and routing tables when a single host needs to be named precisely.

Why subnetting is worth doing

Splitting a flat network into smaller blocks limits how far broadcast traffic travels, which keeps things responsive as a network grows. It also gives you natural boundaries for security policy — putting guest Wi-Fi, printers and servers on separate subnets means a compromised device on one cannot reach the others without passing a firewall rule you control.

It makes addressing legible, too. When every site or department has its own predictable block, an IP address tells you where a device sits without looking anything up.

A worked example

Take 10.20.30.75/26. A /26 leaves 6 host bits, so blocks are 64 addresses wide and fall on boundaries of 0, 64, 128 and 192. The address 75 sits in the second block, giving a network address of 10.20.30.64, a broadcast address of 10.20.30.127, and a usable range from .65 to .126 — 62 hosts.

Frequently asked questions

Why does a /24 give 254 usable hosts instead of 256?

The first address in any block is the network address and the last is the broadcast address. Both are reserved and cannot be assigned to a device, so a 256-address block leaves 254 for hosts.

What is the difference between a subnet mask and a CIDR prefix?

They express the same thing in two notations. A /24 prefix and a 255.255.255.0 mask both mean the first 24 bits identify the network. CIDR notation is shorter and is what modern configuration usually uses.

How do I know which subnet an IP address belongs to?

Enter the address and its prefix into the calculator. The network address it returns is the start of the block that address falls in, and the usable host range shows the rest of that block.

Why does a /31 show two usable hosts?

A /31 is a special case defined for point-to-point links. Because only two devices exist on such a link, no network or broadcast address is reserved and both addresses are usable.

Does this calculator support IPv6?

Not currently. It handles IPv4 addresses with prefixes from /0 to /32. IPv6 subnetting uses 128-bit addresses and different conventions.

Last reviewed: · Reviewed by the ShowMyIP team

We use cookies to improve your experience. Learn more.