CIDR Range Calculator
Turn an arbitrary start–end IP range into the smallest exact set of CIDR blocks, or expand CIDR blocks into their first and last address.
Processed locally in your browser· Your data stays in your browser.
What is CIDR Range Calculator?
Firewalls, security groups and route tables speak CIDR, but address ranges often arrive as "start - end". A range only maps to a single CIDR block when it is aligned to a power of two; otherwise it must be covered by several blocks. This tool finds the minimal set that covers exactly the range, with no address inside or outside it left over.
Choose the direction: range → CIDR (one range per line, separated by a hyphen or "to") or CIDR → range (one block per line). IPv4 and IPv6 are handled with exact BigInt arithmetic and a per-line summary is shown for multi-line input.
How does it work?
- Select "IP range → CIDR blocks" or "CIDR → first / last IP".
- Enter one range or block per line, such as 10.0.0.5 - 10.0.1.20 or 172.16.0.0/12.
- Copy the resulting list; single-line input also shows total addresses and the number of blocks.
- Lines that cannot be parsed are reported individually without stopping the others.
Common use cases
- Converting a provider’s "first - last" allocation into rules for an allow-list.
- Summarizing a contiguous set of addresses to keep a routing table or ACL short.
- Finding the exact first and last address covered by a CIDR block in a firewall rule.
- Checking how many blocks an awkward range like .5 to .20 really needs.
Examples
Try this input in the tool above:
10.0.0.5 - 10.0.1.20
10.0.0.5/32 10.0.0.6/31 10.0.0.8/29 10.0.0.16/28 10.0.0.32/27 10.0.0.64/26 10.0.0.128/25 10.0.1.0/28 10.0.1.16/30 10.0.1.20/32
Privacy
CIDR Range Calculator runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
The result is exact and minimal for the given range, but it does not merge separate input lines together. Ranges must use the same address family on both ends.
Frequently asked questions
Why is 10.0.0.5 - 10.0.1.20 more than one block?
Because it does not start and end on a power-of-two boundary. The minimal cover is 10.0.0.5/32, 10.0.0.6/31, 10.0.0.8/29, 10.0.0.16/28, 10.0.0.32/27, 10.0.0.64/26, 10.0.0.128/25, 10.0.1.0/28 and smaller pieces up to .20.
Can I supply a CIDR with host bits set?
Yes. In CIDR → range mode the block is normalised to its network address first, so 192.168.1.77/24 yields 192.168.1.0 - 192.168.1.255.
Does it work for IPv6?
Yes. Both directions support IPv6, and total address counts are exact big integers.
Related tools
CIDR Calculator
Type a network such as 192.168.1.0/24 and get every subnet detail at once: masks, host range, address counts and class.
Network Tools
Subnet Calculator
Divide a network such as 192.168.0.0/24 into 4 subnets, or into /26 blocks, and get a ready-to-use allocation table.
Network Tools
IPv4 Address Validator
Paste one or many IPv4 addresses to see whether each is valid, why not if it is not, and what kind of address it is.
Network Tools
IPv6 Address Validator
Check an IPv6 address, then see its canonical short form, its full 32-digit form and what kind of address it is.
Network Tools
IP to Decimal Converter
Get the integer behind an IP address, in decimal or hex, for one address or a whole list.
Network Tools
Decimal to IP Converter
Turn a decimal, 0x hexadecimal or 0b binary integer into the IPv4 or IPv6 address it represents.
Network Tools