How to Use the CIDR & Subnet Calculator
- Enter an IPv4 address followed by a slash and a prefix length (0–32), for example 10.0.5.0/22. You can also pick a common prefix from the quick chips.
- The calculator instantly returns the network address, first and last usable host, broadcast address, subnet mask and wildcard mask, plus the total and usable host counts.
- Copy the full result with one click for your firewall rule, Terraform config or network documentation.
What Is CIDR?
CIDR (Classless Inter-Domain Routing) is the standard way to describe a block of IP addresses. It is written as an IP address followed by a slash and a prefix length — the number of leading bits that are fixed. For example, 192.168.1.0/24 fixes the first 24 bits (the first three octets), leaving 8 bits for hosts, which yields 256 addresses.
Every subnet has a network address (the first address, where all host bits are zero) and a broadcast address (the last address, where all host bits are one). On IPv4 networks these two addresses cannot be assigned to devices, so the usable host count is 2^(32−prefix) − 2 for prefixes smaller than /31.
The subnet mask is the dotted-decimal expression of the same prefix: /24 equals 255.255.255.0. The wildcard mask (its inverse, 0.0.0.255) is what Cisco-style ACLs and OSPF configuration use. Cloud platforms and orchestrators express the same ranges in CIDR notation — VPCs, subnets, security groups and Kubernetes ClusterIP ranges all expect CIDR blocks.
Subnetting — splitting a larger block into smaller ones — is how network designers isolate environments and conserve address space. Getting the boundaries wrong means overlapping routes, unreachable hosts or firewall rules that silently fail. Doing the binary math by hand is error-prone, which is why engineers keep a subnet calculator open while designing or troubleshooting networks.
Common Use Cases
- Cloud VPC and subnet design. Plan AWS VPC, Azure VNet or GCP subnet ranges and confirm they do not overlap before provisioning.
- Firewall and ACL rules. Translate between CIDR notation and subnet/wildcard masks when writing security group or router rules.
- Kubernetes and Docker networking. Size pod and service CIDR ranges and verify the pod network has enough addresses for your nodes.
- VPN and site-to-site configs. Confirm the tunnel traffic selectors and remote subnets match on both ends of an IPsec or WireGuard tunnel.
- Troubleshooting connectivity. Check whether two hosts are actually in the same subnet or whether a gateway address falls inside the range.
Frequently Asked Questions
What is a CIDR prefix?
The prefix is the number after the slash (0–32 for IPv4). It counts the fixed leading network bits. /24 means 24 network bits and 8 host bits, giving a block of 256 addresses (254 usable hosts).
How many usable IPs are in a /24?
A /24 contains 256 total addresses. The network address and broadcast address are reserved, leaving 254 usable host addresses. The calculator shows total and usable counts for every prefix.
What is the difference between subnet mask and wildcard mask?
The subnet mask marks the network bits (for /24: 255.255.255.0). The wildcard mask is its bitwise inverse (0.0.0.255) and is used in Cisco ACLs and routing protocol configuration.
Does the calculator support IPv6?
This version focuses on IPv4, where subnetting math and broadcast/network reservations are most commonly needed day to day. IPv6 uses 128-bit prefixes (typically /64 per subnet) with no broadcast addresses.
Is any data sent over the network?
No. The address math is pure arithmetic performed by JavaScript in your browser. The IP you type never leaves your device, which makes the tool safe for internal network documentation.