IP Range Size Calculator
Count how many IPv4 addresses lie between two IPs and express the range as the minimal set of CIDR blocks.
Last reviewed by the Radiatus Cloud team
Count the IPv4 addresses between two IPs and express the range as CIDR blocks.
Need this monitored 24/7?
Radiatus delivers managed cloud & network operations.
Count addresses and find covering CIDR blocks
Given any two IPv4 addresses, this calculator counts how many addresses lie in the inclusive range between them and expresses that range as the smallest possible set of CIDR blocks. Counting is simple subtraction once the addresses are treated as integers, but covering an arbitrary range with aligned CIDR blocks requires a greedy algorithm that repeatedly picks the largest block that starts at the current position and does not overshoot the end. The tool runs this algorithm and lists the resulting blocks.
For example the range from 192.168.1.10 to 192.168.1.40 contains thirty-one addresses and is covered by a handful of CIDR blocks of varying sizes.
Why convert ranges to CIDR
Firewalls, routing tables and access-control lists are usually written in CIDR notation rather than as start-and-end ranges, so administrators often need to translate a human-friendly range into the exact set of prefixes that cover it. Doing this by hand is tedious and error-prone, especially when the range does not align neatly to a power-of-two boundary.
The number of blocks needed depends on how the range aligns: ranges that fall on natural subnet boundaries need just one block, while awkward ranges need several. All calculation happens locally in your browser, matching the output of standard networking libraries.
Related tools
- Port Scanner — Check which common ports respond on a host and understand what each exposed service means. Scan only systems you are authorised to test.
- DNS Misconfiguration — Analyze DNS records (TXT, SPF) for security gaps.
- TLS Compat Tester — Check client-server compatibility for TLS versions.
- Firewall Rule Risk — Evaluate firewall rules for over-permissive exposure.
Frequently Asked Questions
How is the address count calculated?
Both addresses are converted to integers and subtracted, then one is added because the range is inclusive of both endpoints.
Why does the range need several CIDR blocks?
CIDR blocks must align to power-of-two boundaries. A range that does not start and end on those boundaries is covered by a combination of differently sized blocks.
What if I enter the addresses in the wrong order?
The tool automatically swaps them so the smaller address is treated as the start, so the order you type them in does not matter.
Does this match tools like Python ipaddress?
Yes. The greedy block-covering algorithm produces the same minimal set of CIDR blocks as standard networking libraries.
Can the range span different octets?
Yes. Any start and end within the IPv4 space is supported, including ranges that cross octet boundaries.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Enter a start and end IPv4 address to count the addresses and get the covering CIDR blocks.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
Port Scanner
NetworkCheck which common ports respond on a host and understand what each exposed service means. Scan only systems you are authorised to test.
DNS Misconfiguration
NetworkAnalyze DNS records (TXT, SPF) for security gaps.
TLS Compat Tester
NetworkCheck client-server compatibility for TLS versions.