HuntsvilleEngineers mark

CIDR Subnet Calculator

Turn an IPv4 address and prefix length into network, broadcast, host range, and usable host count.

Inputnetwork = IP AND mask , mask = 0xFFFFFFFF << (32 − prefix) , broadcast = network OR ~mask , hosts = 2^(32−prefix) − 2

Your recent runs (stored only in your browser)

No calculations yet — results land here so you can compare runs.

The engineering

Classless Inter-Domain Routing (CIDR) drops the old Class A/B/C boundaries and lets the prefix length — the count of leading 1-bits in the mask — set the network/host split at any bit. Enter the four octets and a /prefix and this card ANDs the address with the mask to find the network, ORs in the inverted mask for the broadcast, and counts the block.

Rule of thumb: usable hosts is 2^(32−prefix) minus 2, because the all-zeros host is the network number and the all-ones host is the broadcast. The two exceptions are /31, where RFC 3021 reclaims both addresses for point-to-point links, and /32, which is a single-host route.

Sanity check: the network and broadcast should bracket your host range, and the address you typed must fall inside them. If the network address differs from what you entered, your host bits were non-zero — normal for identifying which subnet an address belongs to.

Where this math comes from

By the early 1990s the classful scheme was burning through the IPv4 space: an organization needing 300 hosts had to take a full Class B (65,534 hosts) because a Class C only held 254. The routing tables of the growing Internet were also exploding. CIDR was the pragmatic fix, sketched by engineers at the IETF who needed to buy the Internet time until IPv6 arrived.

The scheme was first specified in RFC 1519 in 1993 and refined into RFC 4632 in 2006. The 'slash' notation — 192.168.1.0/24 — became the everyday shorthand for a variable-length mask, and route aggregation (supernetting) kept the backbone routing tables from collapsing under their own weight.

  1. 1981Jon Postel / RFC 791IPv4 defined with fixed Class A/B/C address boundaries.
  2. 1985RFC 950Subnetting adds a mask, letting a network be split internally.
  3. 1993Fuller, Li, Yu & Varadhan / RFC 1519CIDR introduced — classless prefixes and route aggregation.
  4. 2000RFC 3021Allows /31 prefixes on point-to-point links, reclaiming both addresses.
  5. 2006Fuller & Li / RFC 4632Current CIDR standard consolidating the address-allocation architecture.

See the full timeline of the math behind every calculator →

Runs entirely in your browser — nothing you enter leaves this page. Your recent runs are stored only on your device.