CIDR Subnet Calculator
Enter an IPv4 block such as 10.0.4.0/22 and get every number at once: network and broadcast addresses, first and last usable host, dotted netmask, the wildcard mask for ACLs, host counts, and whether the block is RFC 1918 private. Add a bare address on a second line to check whether it falls inside the block, or set a prefix to split the block into equal subnets. Nothing is uploaded.
Calculates as you type. Ctrl+Enter to re-run.
Guide & FAQ
Work out an IPv4 subnet without doing binary maths on paper: paste a CIDR block and read off the network address, broadcast address, usable host range, netmask, wildcard mask and total host count. Useful when carving a VPC into per-availability-zone subnets, sizing a DHCP pool, writing a firewall or security-group rule, or answering "is this IP inside that block?" during an incident. Everything is computed in your browser - no addresses are uploaded.
What it does
- Expand a CIDR block into network, broadcast, first and last usable host, and the full address range.
- Convert prefix to mask - /22 becomes 255.255.252.0, with the wildcard mask 0.0.3.255 that Cisco ACLs use.
- Count hosts correctly, including the /31 point-to-point case (RFC 3021) and /32 host routes where no broadcast address is reserved.
- Flag the scope: RFC 1918 private, RFC 6598 carrier-grade NAT, link-local, loopback, multicast or documentation ranges.
- Split a block into equal subnets of any longer prefix, listing each subnet with its usable range.
- Test membership - put a bare address on the line after a block and it reports whether the address is inside it, and its host offset.
When to use it
- Planning VPC or on-premise subnets and needing the usable range for each one.
- Writing a firewall rule, security group or NACL and needing the exact broadcast boundary.
- Reading an ACL that uses wildcard masks instead of prefix lengths.
- Checking whether a client IP in a log line belongs to a known internal block.
- Sizing a DHCP pool or a Kubernetes pod CIDR before allocating it.
- Splitting a /16 allocation into per-environment or per-AZ /24s.
How to use it
- Paste an IPv4 block such as
10.0.4.0/22. A dotted mask (10.0.4.0 255.255.252.0) or a bare address also works. - Read the verdict strip for the usable host count and scope, and the panel below for every derived address.
- To test an address, put it on the next line:
10.0.5.77reports inside or outside, with its host offset. - To carve the block up, set Split into /N subnets and open the Subnets tab.
- Paste several blocks on separate lines to get a comparison table with each block's range, hosts and scope.
FAQ
FAQ
- How many usable hosts are in a /24? 254. A /24 holds 256 addresses, but the first is the network address and the last is the broadcast address, so neither can be assigned to a host on a normal subnet.
- What is a wildcard mask? The bitwise inverse of the subnet mask, used by Cisco ACLs and some firewall syntaxes. A /24 has netmask 255.255.255.0 and wildcard mask 0.0.0.255.
- Why does a /31 show two usable hosts? RFC 3021 allows both addresses of a /31 to be used on a point-to-point link, since such a link has no need for a broadcast address. It saves two addresses per router interconnect.
- Which IPv4 ranges are private? 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 under RFC 1918, plus 100.64.0.0/10 for carrier-grade NAT and 169.254.0.0/16 for link-local addresses. The calculator labels the block automatically.
- How do I split a /16 into /24s? Enter the /16 and set the split prefix to 24. That produces 256 subnets of 254 usable hosts each, listed with their ranges in the Subnets tab.
- How do I convert a subnet mask to a prefix length? Enter the block in the form 10.0.0.0 255.255.252.0 - the mask is converted to /22 automatically, and a non-contiguous mask is rejected as invalid.
- Is my IP data uploaded? No. The whole calculation is integer arithmetic performed in your browser. No addresses, blocks or ranges leave your machine.
Runs locally in your browser. No uploads. Share links use an encrypted URL fragment.