CIDR to IP Range
Paste one or more CIDR blocks, IPv4 or IPv6, and instantly see the first and last IP address, network and broadcast addresses, mask and number of hosts. Need the opposite? Turn any start-to-end IP range into the shortest list of CIDR blocks, or export every address in a block as a text or CSV file.
Last updated:
Also accepts 192.168.1.10 255.255.255.0 (netmask) and single addresses. Commas and spaces between blocks work too.
Export the full IP address list
Both addresses must be the same family. You can also paste a range like 10.0.0.5 - 10.0.0.99 into the first box.
How to use the CIDR to IP Range
- Enter your CIDR blocks, such as 192.168.1.0/24 or 2001:db8::/48, one per line. Click an example chip to try one.
- Read the IP range in the highlighted box: the first and last usable address and how many hosts the block holds.
- Check the details: network and broadcast address, masks, address type and the step-by-step working.
- Export the IP list if you need every address: pick the block, usable or all addresses and a format, then generate, copy or download it.
- Convert a range to CIDR on the second tab by entering a first and last IP address to get the minimal set of CIDR blocks.
How CIDR notation maps to an IP range
CIDR (Classless Inter-Domain Routing, RFC 4632) writes a network as an address plus a prefix length, like 192.168.1.0/24. The prefix says how many leading bits are fixed for the network; the rest are free for hosts. With h host bits (32 − prefix for IPv4, 128 − prefix for IPv6) the block always contains exactly 2h addresses and always starts on a multiple of that size.
- First IP (network address) = IP AND subnet mask (all host bits 0).
- Last IP (broadcast in IPv4) = network address OR wildcard mask (all host bits 1).
- Usable IPv4 hosts = 2h − 2 for /0 to /30, 2 for a /31 and 1 for a /32.
- IPv6 has no broadcast address, so the full 2h addresses are counted.
Worked example: 172.16.5.37/20 has 12 host bits. The mask is 255.255.240.0, so the third octet is rounded down to a multiple of 16: 5 becomes 0. The range is 172.16.0.0 to 172.16.15.255, which is 4,096 addresses and 4,094 usable hosts.
IPv4 CIDR reference table
| CIDR | Subnet mask | Wildcard | Addresses | Usable hosts | Typical use |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | 10.0.0.0/8 private space |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | 172.16.0.0/12 private space |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | Cloud VPC, campus network |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | Large cloud subnet |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | Big office or Wi-Fi network |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Home or small office LAN |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | Department or VLAN |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | Small server segment |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | Static IP block from an ISP |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Classic point-to-point link |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | Point-to-point link (RFC 3021) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Single host, firewall rule |
Cloud providers often reserve extra addresses in each subnet (for example the first four and the last one), so the number you can actually assign there can be lower than the usable host count above.
Common IPv6 prefix sizes
| Prefix | Number of /64 subnets | Typical holder |
|---|---|---|
| /32 | 4,294,967,296 | ISP or large organization allocation |
| /48 | 65,536 | One site or organization |
| /56 | 256 | Home or small business customer |
| /60 | 16 | Some residential ISPs |
| /64 | 1 (264 addresses) | A single LAN segment, required for SLAAC |
| /127 | — | Point-to-point router link (RFC 6164) |
| /128 | — | Single address, loopback |
Tips for working with CIDR ranges
- Allow-lists and firewall rules: summarize a range with the IP range to CIDR tab instead of listing hundreds of single addresses. Ranges that do not start on a block boundary need several CIDR entries.
- Check for overlaps before creating VPCs, VPN routes or Docker networks. Paste all your blocks at once and the tool flags any block that sits inside another.
- Documentation addresses such as 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 and 2001:db8::/32 are reserved for examples and are never routed on the internet.
- Leading zeros in IPv4 octets (like 010.0.0.1) are rejected because some software reads them as octal numbers.
Frequently asked questions
What does a CIDR block like /24 mean?
The number after the slash is the prefix length: how many leading bits of the address identify the network. The remaining bits identify hosts. An IPv4 /24 leaves 32 - 24 = 8 host bits, so it contains 2^8 = 256 addresses, for example 192.168.1.0 to 192.168.1.255.
How do I calculate the first and last IP of a CIDR range?
The first address (network address) is the IP with all host bits set to 0, which is the IP AND the subnet mask. The last address is the IP with all host bits set to 1, which is the network address OR the wildcard mask. For 172.16.5.37/20 that gives 172.16.0.0 to 172.16.15.255.
Why are there 2 fewer usable hosts than addresses in IPv4?
In a normal IPv4 subnet the first address identifies the network and the last address is the broadcast address, so neither is assigned to a device. A /24 therefore has 256 addresses but 254 usable hosts. The exceptions are /31, used for point-to-point links where both addresses are usable (RFC 3021), and /32, which is a single host.
How is IPv6 different?
IPv6 has 128-bit addresses and no broadcast address, so every address in the prefix is counted as usable. The numbers get huge: a single /64, the standard size for one IPv6 subnet, holds 2^64 = 18,446,744,073,709,551,616 addresses, and a /48 contains 65,536 of those /64 subnets.
What happens if I enter an IP with host bits set, like 10.1.2.3/8?
The tool keeps the prefix and works out the block the address belongs to, here 10.0.0.0/8, and shows a note. Many routers and firewalls reject or silently correct such entries, so it is best to write the network address.
How do I convert an IP range to CIDR?
Use the IP range to CIDR tab. Starting at the first address, it takes the largest aligned power-of-two block that does not go past the last address, then repeats from the next address. For example 192.168.0.10 to 192.168.0.200 becomes 8 blocks, from 192.168.0.10/31 to 192.168.0.200/32.
Can I download every IP address in a CIDR block?
Yes, for blocks of up to 1,048,576 addresses (an IPv4 /12 or an IPv6 /108). Choose usable hosts or all addresses, one per line, comma-separated or CSV, and download the file. The list is generated in your browser.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.