CIDR to IP Range Converter (IPv4 and IPv6)
Convert between CIDR blocks and IP ranges, merge CIDRs and expand ranges.
Use via API
Convert IPv4/IPv6 CIDR blocks to first–last ranges, ranges to the minimal CIDR list, merge overlapping CIDRs and ranges, or list every address in a small block. Send JSON, get JSON back.
POST https://pithlab.com/api/v1/tools/cidr-ip-range-converter
curl https://pithlab.com/api/v1/tools/cidr-ip-range-converter \
-H "Authorization: Bearer $PITHLAB_KEY" \
-H "Content-Type: application/json" \
-d '{"input":"192.168.0.0 - 192.168.2.255\n10.0.0.0/23\n10.0.2.0/23","mode":"merge"}'About the CIDR to IP Range Converter
Convert CIDR blocks to first and last IP and address count, turn IP ranges into the fewest CIDRs, merge overlapping CIDRs and list IPs. IPv4 and IPv6.
How to use the CIDR to IP Range Converter
- Pick a mode: CIDR to range, Range to CIDR, Merge CIDRs or Expand to IPs.
- Paste one entry per line. Ranges are written as start - end, for example 10.0.0.0 - 10.0.0.255. Lines starting with # are ignored.
- Read the result, which updates as you type. Lines that cannot be read are listed with the reason.
- Copy the output or download it as a text file.
Examples
Input
192.168.1.0/24
Output
192.168.1.0/24: 192.168.1.0 - 192.168.1.255 (256 addresses)
Input
2001:db8::/126
Output
2001:db8::/126: 2001:db8:: - 2001:db8::3 (4 addresses)
Input
10.0.0.1 - 10.0.0.10
Output
10.0.0.1/32 10.0.0.2/31 10.0.0.4/30 10.0.0.8/31 10.0.0.10/32
Input
10.0.0.0/24 10.0.1.0/24 10.0.0.128/25
Output
10.0.0.0/23
Frequently asked questions
What does a CIDR block like /24 mean?
The number after the slash is how many leading bits are fixed. An IPv4 /24 fixes 24 of 32 bits, leaving 8 bits, so it covers 2^8 = 256 addresses. Each step down in prefix doubles the size.
Why does one range turn into several CIDR blocks?
A CIDR block must start on a boundary that matches its size, so most arbitrary ranges cannot be written as one block. The tool picks the largest aligned block at each step, which gives the shortest possible list.
What happens if my CIDR has host bits set, like 192.168.1.10/24?
It is treated as the network it belongs to, 192.168.1.0/24, which is how routers and firewalls read it.
Does the address count include the network and broadcast addresses?
Yes. The count is every address in the block. For usable IPv4 host counts, subtract 2 for most subnets, or use the subnet calculator, which shows the usable range.
Is my data sent anywhere?
No. Everything is calculated in your browser, so your address lists never leave your device.