IPv4 CIDR Calculator
Type a CIDR block in the input (default 192.168.1.0/24) and click Calculate. The tool parses the IPv4 address and prefix length, builds the subnet mask, and prints network address, broadcast, netmask, total size, usable host count, and first/last assignable hosts.
Click Calculate.
About this tool
Prefix must be 0–32 and each octet must be 0–255. For typical subnets larger than /31, two addresses are reserved for network and broadcast, so usable hosts equals size minus two. Invalid formats show a clear error such as Use a.b.c.d/prefix.
How to use
- Open the calculator: Load the page and locate the CIDR input and Calculate button.
- Enter your block: Type an IPv4 address followed by slash and prefix, for example 10.0.0.0/8.
- Click Calculate: Press Calculate to compute mask, network, broadcast, and host range.
- Read the summary: Review the multi-line output for netmask, host count, and first/last IPs.
Common use cases
- Plan office VLAN sizing before requesting a /24 or /26 from network ops.
- Double-check firewall rules that reference network and broadcast boundaries.
- Teach subnetting by comparing mask bits to first and last host output.
Tips
- /32 lists zero usable hosts because the single address is the network itself.
- Enter the network address or any host inside the block; the mask aligns to the network bit boundary.
FAQ
What input format is required?
Use dotted decimal IPv4, a slash, then prefix length, like 192.168.1.0/24.
How are usable hosts counted?
For most prefixes, usable hosts are total size minus network and broadcast addresses.
What if an octet is out of range?
You will see Invalid IPv4 because each part must be an integer from 0 to 255.
Is the calculation done on a server?
No. Bitwise math runs in your browser when you click Calculate.