CIDR Calculator
Convert an arbitrary IPv4 address range into the minimal list of CIDR blocks that covers it exactly.
Your inputs
Results
Minimal CIDR blocks
10.0.0.5/32, 10.0.0.6/31, 10.0.0.8/29, 10.0.0.16/30, 10.0.0.20/32
- Number of blocks
- 5
- Addresses covered
- 16
✓Exact calculation — rounded only for display
Notes for this result
- Computed entirely in your browser; no address is sent anywhere.
What this calculator does
Firewall rules and route tables often need CIDR blocks. An unaligned range may need several blocks.
Formula and method
Repeatedly take the largest aligned block that starts at the current address and stays within the range.
Worked example
Calculated by this tool with its default inputs:
Inputs
- First address in the range: 10.0.0.5
- Last address in the range: 10.0.0.20
Results
- Minimal CIDR blocks: 10.0.0.5/32, 10.0.0.6/31, 10.0.0.8/29, 10.0.0.16/30, 10.0.0.20/32
- Number of blocks: 5
- Addresses covered: 16
How to read the results
Fewer blocks means simpler configuration; aligned ranges collapse to a single block.
Assumptions and limitations
- Calculated entirely in your browser — addresses and values are never sent to a server.
Questions
Why not one block?
A CIDR block must start on a boundary that is a multiple of its size.
Sources
Methodology and verification
- Result type
- Exact mathematical calculation (rounded only for display)
- Formula version
- 1.0
- Automated verification
- 4 reference and validation test cases, checked against independently computed values. The site cannot be built if any of them fail.
- Editorial review
- Awaiting human editorial review. The explanation was drafted with AI assistance; the formula and examples are verified by the automated tests above.
Privacy
Everything you enter is calculated in this browser and is not sent to Numerith or anyone else. Inputs are added to a share link only if you choose to include them. Privacy policy