IP Range to CIDR Converter
Convert IP address ranges to CIDR notation and back. Batch convert multiple ranges, view network details, and copy results instantly.
About This Tool
The IP Range to CIDR Converter is a free browser-based tool that converts start-to-end IPv4 address ranges into the minimal set of CIDR (Classless Inter-Domain Routing) notation blocks that exactly cover the range. It also supports the reverse operation: converting a CIDR block back to its first and last IP addresses.
Network engineers, DevOps teams, and security professionals regularly need to convert IP ranges to CIDR notation when configuring firewall rules, cloud security groups, VPN tunnels, and access control lists. Manually calculating the optimal set of CIDR blocks for an arbitrary range is tedious and error-prone. This tool automates the process and displays the network address, broadcast address, and host count for each resulting block.
The Batch Mode lets you paste multiple ranges at once (one per line) and convert them all simultaneously, which is useful when migrating firewall rules or auditing IP allowlists. The CIDR to Range mode does the reverse calculation, showing you exactly which IPs a given CIDR block covers.
If you need to calculate subnet masks and host ranges for a single network, try the Subnet Calculator. For converting between number bases (binary, hex, decimal) which is useful when working with IP addresses at the bit level, see the Number Base Converter. DNS administrators may also find the DNS Record Reference helpful.
All processing runs entirely in your browser using JavaScript. No IP addresses, ranges, or network information is ever sent to any server.
How to Use
- Select a mode at the top: Range to CIDR, CIDR to Range, or Batch.
- For Range to CIDR, enter a Start IP and End IP address, then click Convert or press Ctrl+Enter.
- Review the results table showing each CIDR block, its network address, broadcast address, and host count.
- For CIDR to Range, enter a CIDR block (e.g.
10.0.0.0/16) and click Convert to see the first and last IP. - For Batch mode, paste multiple IP ranges (one per line, formatted as
start - end) and click Convert All. - Check the Total IPs counter to verify the range is covered correctly.
- Click Copy or press Ctrl+Shift+C to copy all results to your clipboard.
Popular IP Range to CIDR Examples
FAQ
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation represents an IP address and its associated network prefix. For example, 192.168.1.0/24 means the first 24 bits are the network portion, leaving 8 bits for host addresses (256 addresses total). CIDR replaced the older classful addressing system and allows more flexible allocation of IP address space.
Why do I get multiple CIDR blocks for one range?
A CIDR block must have a size that is a power of 2, and its starting address must be aligned to that size. If your IP range doesn't align to a single power-of-2 boundary, it must be expressed as multiple CIDR blocks. For example, the range 192.168.1.0 - 192.168.1.130 cannot be a single CIDR block because 131 addresses is not a power of 2. The tool finds the minimal set of CIDR blocks that exactly covers the range.
Does this tool support IPv6?
Currently this tool supports IPv4 addresses only. IPv6 CIDR conversion works on the same principles but with 128-bit addresses instead of 32-bit. IPv6 support may be added in a future update.
What is the difference between network and broadcast addresses?
The network address is the first address in a CIDR block (all host bits set to 0) and identifies the network itself. The broadcast address is the last address (all host bits set to 1) and is used to send packets to all hosts on that network. In a /24 network like 192.168.1.0/24, the network address is 192.168.1.0 and the broadcast address is 192.168.1.255.
How is the host count calculated?
The host count is 2^(32 - prefix). For a /24, that's 2^8 = 256 total addresses. Note that this includes the network and broadcast addresses. The number of usable host addresses is typically 2 fewer (254 for a /24), though this tool displays the total address count for accuracy in range calculations.
Is my data safe?
Yes. All calculations run entirely in your browser using JavaScript. No IP addresses, ranges, or network information is ever sent to any server. You can verify this by checking the Network tab in your browser's developer tools while using the tool.
What format should I use for batch mode?
Enter one IP range per line in the format 'start_ip - end_ip'. For example: '10.0.0.0 - 10.0.0.255'. The dash separator can have spaces around it. Each line is processed independently, so an error in one line won't affect the others.
Related Tools
Subnet Calculator
Calculate IPv4 subnet details including network address, broadcast, host range, and CIDR notation.
Number Base Converter
Convert numbers between binary, octal, decimal, hexadecimal, and custom bases with bit visualization.
DNS Record Generator
Generate DNS zone records including A, AAAA, CNAME, MX, TXT, NS, and SRV records. Export as BIND zone file format.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes for text and files.
CIDR Range Calculator
Calculate CIDR ranges, detect overlaps, check containment, and merge IP blocks. Shows network, broadcast, subnet mask, and host count.
IPv6 Expander / Compressor
Expand and compress IPv6 addresses. Convert between full and shorthand notation with type detection and binary representation.