CIDR Calculator
Enter a CIDR block (e.g. 10.0.0.0/8) to instantly see network address, broadcast, subnet mask, usable host range, and total hosts.
A /n prefix fixes the first n of the 32 address bits.
Use the CIDR Calculator
CIDR Block
Quick examples
Prefix / Host split
Enter a valid CIDR block to see subnet details.
Subnet Details
Binary Representation
Quick answer
A /n prefix fixes the first n of the 32 address bits. The block holds 2^(32 − n) addresses; subtract 2 for the network and broadcast addresses to get usable hosts (/31 and /32 are the exceptions).
Examples
| CIDR | Subnet mask | Usable hosts |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 |
| /16 | 255.255.0.0 | 65,534 |
| /22 | 255.255.252.0 | 1,022 |
| /24 | 255.255.255.0 | 254 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /30 | 255.255.255.252 | 2 |
Enter a CIDR block.
Summary
This CIDR calculator takes any IPv4 address in CIDR notation (e.g. 192.168.1.0/24) and breaks it down into all key subnet details: network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total hosts, and usable hosts. Results update instantly in the browser without any server requests.
How it works
- Enter an IPv4 address with a prefix length such as 192.168.1.0/24 in the input field.
- The tool splits the notation into the host IP and prefix length (0–32).
- It computes the subnet mask by setting the top N bits of a 32-bit integer.
- Network address = IP AND mask; Broadcast = IP OR (NOT mask).
- First usable host = Network + 1; Last usable host = Broadcast - 1.
- Usable host count = 2^(32 - prefix) - 2 (or 2 for /31, 1 for /32).
Use cases
- Plan IP address allocation for VPCs, data centers, or home networks.
- Verify subnet boundaries before configuring routers or firewalls.
- Calculate the broadcast address needed for ACL or routing rules.
- Determine the number of usable hosts in a proposed subnet.
- Understand supernetting by testing large prefix lengths like /8 or /16.
- Cross-check network documentation and IP scheme designs.
- Teach or learn subnetting concepts interactively.
- Validate CIDR blocks in Terraform, Ansible, or cloud configs.