Turn two IPs into a range and CIDR blocks
Given a first and last IP address, it's often useful to know how many addresses the range covers and which CIDR blocks represent it — for firewall rules, allowlists, or documentation. This calculator takes two addresses and returns the total count and the CIDR blocks that exactly cover the span.
How to use it
- Enter the start and end IP addresses.
- Read the address count and the covering CIDR blocks.
- Use the blocks in a rule or record.
Where it helps
- Expressing an arbitrary range as CIDR blocks for a firewall.
- Counting how many addresses a range includes.
- Documenting an allocated span of addresses.
Questions people ask
Why does one range need several CIDR blocks? CIDR blocks have power-of-two sizes aligned to boundaries, so an arbitrary range is covered by a set of blocks rather than one.
Is my input stored? No — the calculation runs in your browser.