>_ MoriDev dev.moritools.com
IPv4 · RFC 4632 100% Client-Side · Zero Upload

IPv4 CIDR & Subnet Mask Calculator

Compute network address, broadcast address, usable host range, wildcard mask, RFC 1918 scope, and 32-bit binary breakdown for any IPv4 CIDR.

Ready (Offline)
Quick Summary

Enter any IPv4 address and prefix length (such as 10.24.16.45/22 or 192.168.1.0/24) to inspect network ID, broadcast address, usable host boundaries, Cisco wildcard mask, RFC 1918 scope, and aligned 32-bit binary octets.

Provisioning AWS VPCs, Kubernetes pod CIDRs, WireGuard VPN peers, or firewall ACLs leaves zero margin for off-by-one subnet overlaps. A miscalculated /22 mask silently swallows adjacent staging subnets and blackholes cluster traffic.

This calculator performs unsigned 32-bit bitwise masking locally, accurately handling edge prefixes including /0 (entire IPv4 space), RFC 3021 /31 point-to-point router links (2 usable hosts), and /32 single-host firewall rules (1 usable host).

Cloud & Networking Subnetting Pitfalls

01. AWS / Cloud VPC Reserved Addresses Beyond Network & Broadcast

Standard RFC math subtracts 2 addresses (network + broadcast), giving 254 hosts in a /24. AWS VPCs reserve 3 additional IPs (.1 router, .2 DNS, .3 future use), leaving 251 assignable EC2/ENI addresses.

02. Miscomputing /31 and /32 Usable Host Counts

Naïve formulas computing (2^(32-n) - 2) return 0 for /31 and -1 for /32. RFC 3021 designates /31 for two-host point-to-point links, and /32 represents a single exact host route.

03. Leading Zeroes Treated as Octal by Legacy Tools

Writing 010.0.0.1 is parsed as 8.0.0.1 by legacy BSD inet_aton libraries, causing SSRF bypasses. Rejecting leading zeroes enforces unambiguous decimal dotted-quad notation.

Frequently Used IPv4 CIDR Block Sizes

CIDR Prefix Subnet Mask Usable Hosts (RFC)
/32 255.255.255.255 1 host (single IP firewall allowlist / loopback)
/31 255.255.255.254 2 hosts (RFC 3021 point-to-point router link)
/28 255.255.255.240 14 hosts (16 total — small NAT/subnet tier)
/24 255.255.255.0 254 hosts (256 total — classic LAN / VPC subnet)
/22 255.255.252.0 1,022 hosts (1,024 total — Kubernetes node pool)
/16 255.255.0.0 65,534 hosts (65,536 total — full AWS VPC block)

Worked Engineering Examples

Finding Boundaries for 10.24.16.45/22

Input
10.24.16.45/22
Output
Network: 10.24.16.0 · Broadcast: 10.24.19.255 · Usable: 10.24.16.1 – 10.24.19.254 (1,022 hosts)

A /22 mask zeroes the last 10 host bits, spanning four contiguous /24 blocks from .16.0 through .19.255.

Verifying RFC 3021 Point-to-Point Link

Input
172.16.99.4/31
Output
Network: 172.16.99.4 · Broadcast: None · Usable: 172.16.99.4 – 172.16.99.5 (2 hosts)

Both endpoints are valid assignable interface addresses on modern routers without wasting half the block.

Frequently Asked Questions

What is a wildcard mask and where is it used?

A wildcard mask is the exact bitwise inverse of the subnet mask (e.g., 0.0.0.255 for /24). Cisco IOS ACLs, OSPF network statements, and certain firewall engines use wildcard bits where 0 means "must match" and 1 means "ignore".

Which IPv4 ranges are private under RFC 1918 and CGNAT under RFC 6598?

RFC 1918 defines 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for private internal networks. RFC 6598 reserves 100.64.0.0/10 for Carrier-Grade NAT and overlay meshes like Tailscale.

Can I paste a host IP rather than the base network IP?

Yes. Entering 192.168.10.173/26 automatically masks off the host bits to reveal the true network address 192.168.10.128/26 and usable range .129–.190.

Why does the binary readout highlight network bits vs host bits?

Viewing the exact 32-bit boundary makes it effortless to verify subnet alignment and understand why a /22 block must start on a multiple of 4 in the third octet.

Continue Your Workflow

24 offline developer utilities