IPv4 Range to CIDR Converter
Convert start and end IPv4 addresses into the smallest exact CIDR block list.
Range Conversion
Translate raw address spans into route, ACL, and security-group friendly prefixes without adding extra addresses.
What This Tool Does
This tool converts a start IPv4 address and an end IPv4 address into the smallest set of CIDR blocks that exactly covers the requested range. The form and output stay exactly where they were, but the new content explains why an address span sometimes maps to one prefix and sometimes needs several smaller prefixes.
That distinction matters in firewall policies, routing summaries, cloud object groups, and migration planning. If a range is already aligned to a valid network boundary, the result may be a single CIDR. If the boundaries are uneven, the converter builds a minimal list of prefixes so you do not over-include addresses outside the requested range.
Inputs explained
The start IP is the first IPv4 address that must be included. The end IP is the last IPv4 address that must be included. They can be any valid IPv4 addresses as long as the end is not smaller than the start. The calculator then walks the span from left to right, choosing the largest aligned CIDR block that fits at each step.
How it works
The method is a standard minimal-cover algorithm. Starting from the first address, the tool checks alignment and remaining range size, picks the largest prefix that does not overshoot the end, outputs that block, then repeats until every address in the requested span is covered.
IP Range → CIDR Converter
CIDR Blocks
Step-by-Step Example
Enter 192.168.1.10 as the start and 192.168.1.30 as the end. That span is not aligned to a single power-of-two boundary, so one CIDR block cannot represent it exactly. The tool therefore breaks the range into several smaller prefixes that fit tightly around the requested addresses.
For a clean aligned range such as 192.168.1.0 through 192.168.1.255, the result is simply 192.168.1.0/24. The difference between those two examples shows why range conversion is not just notation swapping. It is a boundary alignment problem.
Use Cases
Use this page when you receive raw start and end IPs in a ticket, spreadsheet, or abuse report and need a concise prefix list for routers, firewalls, or documentation. It is also useful when you want to compress large allowlists into fewer entries while preserving an exact match to the requested address span.
Assumptions and limitations
The output is an informational exact cover for the range entered. It does not check ownership, address reputation, or whether a broader summary would be acceptable for your policy. Review special-purpose space, private space, and operational scope before applying the result in production.
Frequently Asked Questions
How do I convert an IP range to CIDR?
To convert an IP range to CIDR, enter the start IP and end IP, then generate the smallest set of CIDR blocks that covers the range exactly. For example, a clean range like 192.168.1.0 to 192.168.1.255 converts to 192.168.1.0/24. If the range starts or ends on an uneven boundary, it may need multiple CIDRs. This conversion is useful when a vendor gives you a start-end range, but your firewall, router, or cloud security group expects CIDR notation.
Why does an IP range convert to multiple CIDRs?
An IP range converts to multiple CIDRs when it is not aligned to one power-of-two block. CIDR blocks must start on correct binary boundaries and have sizes like 1, 2, 4, 8, 16, 32, and so on. A range such as 192.168.1.10 to 192.168.1.50 cannot be represented exactly by one CIDR block without adding extra addresses. The converter breaks it into valid pieces. This is expected behavior, not a tool problem. Exact coverage is especially important for firewall allowlists.
How do I find CIDR for a start and end IP?
To find CIDR for a start and end IP, paste both endpoints into the converter and review the generated blocks. The output may be one CIDR or a list of several CIDRs, depending on alignment. For example, 10.0.0.0 to 10.0.0.255 becomes 10.0.0.0/24. But 10.0.0.5 to 10.0.0.20 needs multiple blocks for exact coverage. After conversion, check the total address count and first/last addresses to confirm the result matches the original range before using it in production.
How do I convert an IP range for firewall rules?
For firewall rules, convert the IP range into CIDR blocks and paste those blocks into the ACL, security group, or allowlist. Use exact conversion when the range belongs to a customer, partner, or vendor and you must not include extra addresses. If the converter returns several CIDRs, include all of them. Add a comment with the original start and end IP so the rule is understandable later. Before applying, confirm whether the firewall rule is source or destination based, and whether the platform supports multiple CIDRs per rule.
What CIDR contains this IP range?
A single CIDR that contains an IP range is the smallest covering prefix, but it may include extra addresses. Exact minimal CIDRs are different. For example, if your range is 192.168.1.10 to 192.168.1.20, one broader CIDR can cover it, but it will include addresses outside that range. For routing summaries, a covering CIDR can be acceptable if you own all included space. For firewall allowlists, exact coverage is safer. Always decide whether you want 'contains' or 'matches exactly.'
How do I summarize IP ranges?
Summarizing IP ranges means reducing a list of addresses or ranges into fewer CIDR blocks. This helps simplify route tables, firewall rules, monitoring scopes, and documentation. The converter checks alignment and combines where possible without changing the intended coverage. For example, two aligned /25 ranges can become one /24. But uneven ranges may still require several blocks. The goal is not always the fewest possible characters; the goal is the cleanest representation that does not accidentally include the wrong hosts.
Can one CIDR exactly cover my IP range?
One CIDR can exactly cover your IP range only when the range size is a power of two and the start IP is aligned to that block size. For example, 192.168.2.0 through 192.168.2.255 is exactly 192.168.2.0/24. But 192.168.2.10 through 192.168.2.255 cannot be one exact CIDR. The converter will split it into multiple valid blocks. This rule comes from binary addressing, so decimal-looking neatness can be misleading. Trust the boundary math, then verify the first and last addresses.
Sources & References
Related Tools
IPv4 Subnet Calculator
Review host counts and boundaries for a specific IPv4 prefix.
Compare IPv4 Subnets
Check whether the resulting prefixes overlap with another subnet.
CIDR Overlap Checker
Scale the same overlap review across larger prefix lists.