IP range to CIDR
Summarises an IPv4 or IPv6 range into the fewest CIDR blocks that cover exactly the addresses from start to end; that is at most 62 blocks for IPv4 and 254 for IPv6. Both ends must have the same version and start must not be after end.
Updated 2026-10-27
What this tool checks
The tool takes the first and the last address of a range and returns the CIDR blocks that cover exactly those addresses, in order, together with the number of addresses in the range.
How to read the result
Use the blocks where only CIDR notation is accepted: firewall rules, cloud security groups, SPF ip4 and ip6 terms. To check what one of the blocks covers, use the CIDR calculator.
Limitations
- Nothing is looked up: the tool does not say who holds the range.
Use it from code
API reference for IP range to CIDR
curl -i "https://api.lookproof.dev/v1/ip/range-to-cidr?end=192.0.2.20&start=192.0.2.10"A request without payment is answered with 402 Payment Required and the exact price. See the API reference.
Limits
| Input | First address, Last address |
|---|---|
| Deadline | 2 seconds |
| Freshness | Computed from the input; nothing is looked up |
| Price | $0.002 per check |
Findings this tool can report
This tool reports no findings: the result is the computed data.
Frequently asked questions
How many blocks can a range need?
At most 62 for IPv4 and 254 for IPv6, for a range that starts just after a large boundary and ends just before another. Most ranges need only a few.
Can I mix IPv4 and IPv6?
No. Both ends must have the same version, and the start must not be after the end; otherwise the request is refused.
Is the list the smallest possible?
Yes. Each block is as large as it can be while staying inside the range, which gives the fewest blocks that cover exactly the addresses from start to end.