IP range to CIDR
Turn an inclusive IPv4 address range into the smallest exact list of CIDR blocks.
- 1Add input
- 2Review and run
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Enter the first and last IPv4 addresses to get the smallest exact CIDR list. Check each block and copy one or the complete newline-separated list for network configuration.
How to use this tool
- Paste two IPv4 addresses separated by a hyphen, space, tab, or line break.
- Check the inclusive endpoints, address count and CIDR block count before converting.
- Inspect each block and its address range, then copy one block or download the complete list.
Supported inputs and limits
One inclusive IPv4 range per run. The output may need several CIDR blocks; a single broader block would include extra addresses.
This tool does not look up address ownership or validate a firewall or cloud provider policy. Some destinations reject prefixes such as /0.
Calculations stay in this browser; no DNS, geolocation or network scan.
Worked example
Example input
192.0.2.5 - 192.0.2.13
Example options
{}Example output
192.0.2.5/32 192.0.2.6/31 192.0.2.8/30 192.0.2.12/31
When something does not work
Check both IPv4 addresses, their order, and that only one range was entered.
Frequently asked questions
Can every range be represented by one CIDR?
No. Arbitrary endpoints often require several blocks to avoid including addresses outside the range. This tool returns the smallest exact list.
Are the first and last addresses included?
Yes. Both endpoints are included and every generated block stays inside that range.
Can I paste two spreadsheet cells?
Yes. A tab or line break between two IPv4 addresses is accepted. Only one range is processed at a time.
Can I paste this list directly into any firewall?
Check the destination syntax and prefix restrictions first. For example, some services do not accept /0 in an IP allowlist.
Is my input sent to a server?
No. Address arithmetic runs in your browser; this tool does not query or scan the network.
Documentation & further reading
Related tools
IPv4 subnet and netmask calculator
Calculate IPv4 subnet boundaries and usable endpoints, or convert a netmask and prefix.
Aggregate CIDR blocks
Reduce an IPv4 CIDR list without changing its address coverage.
IPv4 number converter
Convert one IPv4 address between dotted decimal, unsigned integer and 32-bit binary.
IPv6 expand and compress
Convert one IPv6 address to canonical, expanded and colon-free 32-digit forms.