IP Subnet Calculator

A CIDR prefix like /24 packs a lot of information into two characters — the network address, the broadcast address, and exactly how many hosts fit in between. Enter an IP and mask to unpack all of it, size a subnet from the number of hosts you need instead, or aggregate several subnets into one supernet.

Start calculating

For personal planning and general reference — verify important results when needed.

Calculate

Select a calculation type, enter your values, and click Calculate to see results with step-by-step solution and visualization.

What a CIDR prefix is actually telling you

Every IPv4 address is 32 bits, split into a network portion and a host portion. The CIDR prefix — the number after the slash — says how many of those 32 bits belong to the network, leaving the rest for individual hosts. A /24 means the first 24 bits are fixed (the network), leaving 8 bits free for host addresses — 2⁸ = 256 possible values, most of them usable.

Common CIDR prefixes and their subnet masks
CIDR Subnet mask Total addresses Usable hosts
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/30255.255.255.25242

Usable hosts is always total addresses minus 2 — one address is reserved to identify the network itself, and the highest address in the range is reserved as the broadcast address. (A /31 is a documented exception used for point-to-point links, and a /32 identifies a single host — both edge cases most subnetting tools, including this one, treat separately from the general formula.)

Network address, broadcast address, and host range worked out

Take 192.168.1.100/24 as an example. The /24 mask fixes the first three octets and leaves the last one free:

  • Network address (all host bits set to 0): 192.168.1.0
  • Broadcast address (all host bits set to 1): 192.168.1.255
  • Usable host range: 192.168.1.1 through 192.168.1.254

Every device you configure with an address ending anywhere from .1 to .254 belongs to that same /24 network and can reach each other directly, without needing a router in between.

Sizing a subnet to fit the hosts you actually need

Rather than picking a CIDR prefix and hoping it's big enough, it's usually more efficient to start from how many devices need addresses and work backward. The rule: find the smallest power of 2 that's at least your host count plus 2.

Need addresses for 50 devices? 2⁶ = 64 is the smallest power of 2 that clears 52 (50 + 2), which corresponds to a /26 network — 64 total addresses, 62 usable. Asking for exactly 50 would round up to the same /26, since subnet sizes only come in powers of two; there's no such thing as a network sized for exactly 50 hosts.

Private address ranges (RFC 1918)

RFC 1918 private IP address ranges
Range CIDR Typical use
10.0.0.0 – 10.255.255.25510.0.0.0/8Large corporate networks
172.16.0.0 – 172.31.255.255172.16.0.0/12Medium networks, Docker defaults
192.168.0.0 – 192.168.255.255192.168.0.0/16Home routers, small offices

These ranges are set aside for internal networks and never routed on the public internet, which is why nearly every home router hands out addresses starting with 192.168 by default — and why two completely unrelated networks can both use the exact same private addresses without conflict, as long as they never connect directly.

If you're planning network capacity alongside addressing — how much bandwidth a given number of devices will need — the Bandwidth Calculator covers that side of network planning.

Frequently Asked Questions

What is an IP subnet?

A subnet is a subdivided range of IP addresses sharing a network prefix. Subnet masks or CIDR notation (e.g., /24) define which bits identify the network versus the host.

What is CIDR notation?

Classless Inter-Domain Routing writes a prefix length after a slash — 192.168.1.0/24 means 24 network bits and 256 addresses (254 usable hosts in typical IPv4 setups).

How many usable hosts does a subnet have?

For IPv4, usable hosts = 2^(32 − prefix) − 2, subtracting network and broadcast addresses unless /31 or /32 special cases apply.

What is the difference between public and private IP ranges?

RFC 1918 private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are for internal networks. Public IPs are routable on the internet.

How do I use this IP subnet calculator?

Enter an IP address and subnet mask or CIDR prefix, then click Calculate. Network address, broadcast, host range, and wildcard mask appear in the results.

How do I size a subnet for a specific number of hosts?

Find the smallest power of 2 that covers your host count plus 2 (for the network and broadcast addresses), then work out how many bits that takes. Needing 50 hosts requires 2^6 = 64 addresses, which is a /26 network with 62 usable hosts. The Subnet from Hosts Needed mode does this automatically.

More utility calculators