IP Subnet Calculator

Calculate network address, broadcast, mask and usable host range from CIDR.

What the IP Subnet Calculator does

A CIDR prefix says how many leading bits identify the network. Everything after those bits addresses hosts inside it, so the prefix length alone determines the subnet mask, the block size and how many hosts the subnet can hold.

Formula

  • Subnet mask = 32 bits with the first /n set
  • Network = IP AND Mask
  • Broadcast = Network OR Wildcard
  • Usable hosts = 2^(32 − n) − 2

Inputs explained

InputUnitRequiredNotes
IPv4 addresstextYes—
CIDR prefix lengthnumberYesThe number after the slash, from 0 to 32. Accepts 0 or more, up to 32.

How to use it

  1. Enter IPv4 address and CIDR prefix length.
  2. Select Calculate.

Worked example

The address 192.168.1.100 with a /24 prefix.

Address
192.168.1.100
CIDR
24

Mask 255.255.255.0, network 192.168.1.0, broadcast 192.168.1.255. Hosts run .1 to .254 — 254 usable out of 256.

Reading the result

  • "Subnets per /24" directly answers "how many of this smaller size fit in my larger block" when subdividing address space already assigned.
  • "Address type" flags private versus public — worth reading against the actual deployment context, since a private-range address behind NAT behaves very differently from the same-looking address on a public interface.

Assumptions and limitations

  • The "hosts = 2^(32−n) − 2" formula assumes a classic, on-premises-style subnet — several major cloud providers reserve more than 2 addresses per subnet (AWS reserves 5), so the usable count there is lower than this classical formula gives.

Common mistakes

  • Applying the "− 2 for network and broadcast" rule uniformly everywhere — the notes flag /31 and /32 as RFC-defined exceptions, and cloud-provider subnets often reserve additional addresses this formula does not account for.

Frequently asked questions

Why does a /24 have 254 usable hosts and not 256?

The all-zeros address identifies the network and the all-ones address is the broadcast. Neither can be assigned to a host.

What is a wildcard mask?

The bitwise inverse of the subnet mask. A /24 mask of 255.255.255.0 has a wildcard of 0.0.0.255, which is the form Cisco ACLs and OSPF use.

Related calculators