Subnet calculator
Enter an IPv4 CIDR, e.g. 192.168.1.0/24 or 10.0.0.1/8.
How does the IPv4 Subnet and CIDR Calculator work?
Enter an IPv4 address in CIDR notation (e.g., 192.168.1.0/24 or 10.0.0.1/8). The calculator computes network and broadcast addresses, usable host ranges, subnet masks, wildcard masks, and total address counts deterministically in your browser without sending external requests.
CIDR Notation and Variable-Length Subnet Masks
Classless Inter-Domain Routing (CIDR) replaced legacy classful address schemes with flexible prefix bit lengths. A /24 prefix indicates that the initial 24 bits designate the network identifier, leaving 8 bits for host addresses (2^8 = 256 total addresses, with 254 usable hosts).
RFC 1918 Private Address Allocations
Three address blocks are reserved for private internal networks: 10.0.0.0/8 (Class A, 16.7M addresses), 172.16.0.0/12 (Class B, 1.04M addresses), and 192.168.0.0/16 (Class C, 65,536 addresses). These addresses cannot be routed across the public internet without Network Address Translation (NAT).
RFC 3021 /31 Subnets for Point-to-Point Links
While traditional subnets reserve the first address for the network ID and the last address for directed broadcasts, RFC 3021 allows /31 prefixes (2 addresses) to be used on point-to-point router links without broadcast overhead, conserving critical IPv4 address space.
Common CIDR Prefix Sizing for Real-World Networks
Choosing the right prefix prevents wasted address space and future renumbering headaches. A /30 provides 2 usable hosts (ideal for legacy point-to-point links), /28 provides 14 usable hosts for small office segments, /24 provides 254 usable hosts for standard LANs, and /16 provides 65,534 usable hosts for large cloud VPCs. Always leave room for growth when sizing production subnets.
Designing Cloud VPCs and Avoiding Overlapping Subnets
When peering multiple cloud VPCs, Kubernetes clusters, or site-to-site VPNs, overlapping CIDR ranges (such as two sites both using 192.168.1.0/24) cause routing conflicts that break cross-network connectivity. Using distinct /20 or /22 blocks carved from 10.0.0.0/8 or 172.16.0.0/12 ensures clean routing tables across hybrid infrastructure.
Frequently Asked Questions
- What is the difference between total and usable host count?
- In standard subnets (/0 through /30), two addresses are reserved for the network ID and broadcast address. Usable hosts equal 2^(32 - prefix) - 2.
- What is a wildcard mask?
- A wildcard mask is the bitwise inverse of a subnet mask (for example, 255.255.255.0 has a wildcard of 0.0.0.255). It is widely used in router access control lists (ACLs) and firewall filtering.
- Why are subnet calculations executed in the browser?
- Deterministic local computation guarantees instant performance and complete confidentiality; your internal network topology is never transmitted over the wire.
- When is a /32 prefix used?
- A /32 prefix (netmask 255.255.255.255) represents a single specific IPv4 host and is commonly used in firewall allowlists, loopback interfaces, and BGP host routes.
- What happens if you enter a host IP instead of the network address?
- The calculator automatically applies the prefix bitmask to derive the true network ID, broadcast address, and valid host range for that CIDR block.
Looking for network details of a specific IP? Try IP lookup.