IPv4 Range Expander
Expand IPv4 CIDR ranges to show all IP addresses
IPv4 Range Expander
Expand IPv4 CIDR ranges to show all IP addresses
About IPv4 Range Expander
Expand IPv4 CIDR notation ranges into complete lists of individual IP addresses. This tool helps network administrators understand the full scope of IP ranges and plan network configurations effectively.
- Convert CIDR notation to IP address lists
- Support for various subnet sizes (/1 to /32)
- Display network and broadcast addresses
- Calculate total host count
- Export results in multiple formats
How to Use IPv4 Range Expander
- Enter CIDR Range - Input IPv4 network in CIDR notation (e.g., 192.168.1.0/24)
- Choose Options - Select whether to include network and broadcast addresses
- Set Limits - Specify maximum number of IPs to display (for large ranges)
- Expand Range - Click to generate the complete list of IP addresses
Advertisement
Frequently Asked Questions
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation is a method for describing IP networks. It consists of an IP address followed by a slash and a number indicating the network prefix length.
How many IP addresses are in different subnet sizes?
/24 contains 256 addresses (254 hosts), /25 contains 128 addresses (126 hosts), /26 contains 64 addresses (62 hosts), and so on. The formula is 2^(32-prefix) total addresses.
Can I expand very large ranges like /8?
While technically possible, very large ranges like /8 (16 million IPs) are limited for display purposes. The tool will show summary information and allow partial expansion.
What are network and broadcast addresses?
The network address is the first IP in a range (all host bits are 0), and the broadcast address is the last IP (all host bits are 1). These are typically not assignable to hosts.
Can I export the IP list?
Yes, you can copy the generated IP list or export it in various formats including plain text, CSV, and JSON for use in other network tools.
Common Use Cases
- Network planning and documentation
- IP address inventory management
- Firewall rule configuration
- DHCP scope planning
- Security scan target lists
- Network monitoring setup
- Subnet validation and verification
- IP allocation planning
Sponsored Content
Technical Details
CIDR Calculation Rules:
- Prefix Length: Number after slash indicates network bits (0-32)
- Host Bits: Remaining bits for host addresses (32 - prefix length)
- Total IPs: 2^(host bits) addresses in the range
- Usable IPs: Total IPs minus 2 (network and broadcast)
- Subnet Mask: Binary representation of network/host boundary
CIDR Reference Table
| CIDR | Subnet Mask | Total IPs | Usable IPs |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
Programming Examples
Python:
import ipaddress
def expand_cidr(cidr):
network = ipaddress.IPv4Network(cidr, strict=False)
return [str(ip) for ip in network.hosts()]
def expand_cidr_all(cidr):
network = ipaddress.IPv4Network(cidr, strict=False)
return [str(ip) for ip in network]
# Example usage
cidr = "192.168.1.0/24"
host_ips = expand_cidr(cidr)
all_ips = expand_cidr_all(cidr)
JavaScript:
function expandCIDR(cidr) {
const [ip, prefix] = cidr.split('/');
const prefixNum = parseInt(prefix);
const hostBits = 32 - prefixNum;
const numIPs = Math.pow(2, hostBits);
const ipNum = ip.split('.').reduce((acc, octet) =>
(acc << 8) + parseInt(octet), 0);
const networkIP = ipNum & (~(numIPs - 1));
const ips = [];
for (let i = 0; i < numIPs; i++) {
const currentIP = networkIP + i;
const octets = [
(currentIP >>> 24) & 255,
(currentIP >>> 16) & 255,
(currentIP >>> 8) & 255,
currentIP & 255
];
ips.push(octets.join('.'));
}
return ips;
}
Advertisement
