tryb

tryb.dev / tool

CIDR Calculator

Expand a CIDR block into its network range, usable host count, and check it against reserved/private address space.

11 charactersPaste text or drop a file up to 5 MB. Nothing leaves this browser tab.

Transform chain

Apply an exact order locally. Each step receives the previous step's output.

No transforms. Add a step to build a chain.

Analyzing…

Scrubbed from this tab
Clears the paste box, results, and permalink fragment from this browser tab.

CIDR (Classless Inter-Domain Routing) notation compresses a network's address range into an IP address plus a prefix length — 10.0.0.0/24 means the first 24 bits are fixed as the network portion and the remaining 8 bits vary across hosts, giving 256 total addresses in that block. The prefix length is the single number that determines everything else about the range: the subnet mask, the total address count, and — for IPv4 specifically — the usable host count, which is 2 less than the total because the first address (network) and last (broadcast) are reserved.

Getting the host-count math wrong by one is an extremely common off-by-one error in infrastructure planning: a /24 has 256 total addresses but only 254 usable hosts, and a /30 (4 addresses) has exactly 2 usable hosts, which is why /30 and /31 blocks are the standard sizing for point-to-point router links. IPv6 doesn't reserve a broadcast address the same way IPv4 does, so its usable-host math differs — worth checking explicitly rather than assuming IPv4 conventions carry over.

Certain ranges are reserved by standards bodies and carry specific meaning: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are the RFC 1918 private-use ranges that never appear on the public internet; 127.0.0.0/8 is loopback; 169.254.0.0/16 is link-local (the range a host assigns itself when DHCP fails); and 100.64.0.0/10 is the less commonly known shared-address-space range used by carrier-grade NAT. Recognizing these matters for security review — a firewall rule or exposed service that should only be reachable from private space, but is bound to a public-range CIDR, is a real finding.

This calculator expands any IPv4 or IPv6 CIDR block into its network and broadcast addresses, usable host range, and total/usable host counts, and cross-references the block against the standard reserved and private ranges to flag anything notable about where it sits in the address space.

Edge cases worth knowing

A /31 or /32 block
A /31 has exactly 2 addresses and, per RFC 3021, both are usable as host addresses for point-to-point links — no network/broadcast reservation applies at that size. A /32 is a single host route with no subnet structure at all. This calculator handles both as special cases rather than applying the general n-minus-2 formula.
An IPv6 prefix that looks unusually short, like /32
IPv6 prefix conventions are different from IPv4's — a /32 in IPv6 is an enormous allocation (typically assigned to an entire ISP), not a tiny one. This calculator reports the address count using IPv6's actual 128-bit space rather than IPv4-scaled intuition.
A CIDR block whose IP address isn't aligned to the prefix boundary
10.0.0.5/24 specifies a prefix length that would normally align to 10.0.0.0, but the given address has non-zero bits in the host portion. This calculator normalizes to the correct network address and flags that the input address wasn't already network-aligned.

Common mistakes

  • Forgetting that a /24 provides 254 usable IPv4 hosts, not 256, when capacity-planning a subnet.
  • Assuming IPv6 subnets reserve a broadcast address the same way IPv4 does.
  • Exposing a service's bind address on a public CIDR range when it was only ever intended to be reachable from RFC 1918 private space.
  • Confusing carrier-grade NAT shared space (100.64.0.0/10) with ordinary private-use space (10.0.0.0/8) when auditing which ranges should never appear in public-facing configuration.