IP Range ⇔ CIDR Converter
Enter a start and end IP to split that range into the smallest possible set of CIDR blocks, or enter CIDR notation (e.g. 192.168.1.0/24) to get the block's first/last IP and total address count. Useful for firewall and ACL rule authoring.
To check a single IP with a subnet mask, see the subnet calculator , or for a reference table by prefix length, see the CIDR reference table .
Tips
- Handy for turning a firewall or ACL range like "192.168.1.1 to 192.168.1.254" into CIDR notation your router configuration actually accepts.
- Unless the range boundaries happen to align to a clean power of two, the IP range → CIDR conversion will produce several blocks. If you get too many blocks, reconsider where the range starts and ends to keep your ACL simpler.
- For CIDR → IP range, even if the IP you enter isn't the exact start of a block, the tool rounds it to the network and broadcast address of the block it belongs to.
- If you only need to check a single IP and mask, try the subnet calculator; for a full lookup table by prefix length, the CIDR reference table is a good companion to this tool.
Frequently Asked Questions
Side Note — The algorithm behind IP range to CIDR conversion
The algorithm for splitting an IP range into CIDR blocks is a classic, approachable example of a "greedy algorithm" in computer science. The procedure is simple: at each position, pick the largest block that satisfies both how many bits of power-of-two alignment the current address has and how much of the remaining range is left, advance past that block, and repeat until you reach the end. This greedy approach is provably optimal — it always produces the theoretical minimum number of blocks.
In practice, engineers run into systems — cloud security groups, on-premises router ACLs, and more — that only accept CIDR notation rather than an arbitrary IP range. Converting an allocation handed down by a cloud provider, or a range that's been tracked internally as "10.1.0.10 to 10.1.0.50" in a spreadsheet, into router-ready CIDR blocks is an unavoidable step. Doing the bit arithmetic by hand is tedious and error-prone, which is exactly where a conversion tool like this one earns its keep.
The reverse direction — deriving an IP range from CIDR notation — comes up whenever you need a human-friendly "start to end" view of an allocated block. If a provider hands you "203.0.113.0/28", being able to instantly confirm the usable range is 203.0.113.0 through 203.0.113.15 lets you set up firewall allow-lists or DHCP scopes correctly the first time.