Random IPv4 Address Generator
Generate random IPv4 addresses by class (A-E), exclude private/reserved ranges, add CIDR notation, and export results. Bulk generation up to 10,000 IPs.
About
Misconfigured test environments with hardcoded or sequential IP addresses produce unreliable load-testing results and can leak production infrastructure details. This generator produces cryptographically random IPv4 addresses filtered by network class (A through E) using crypto.getRandomValues rather than Math.random, which is not uniformly distributed across the 32-bit address space. Private ranges defined in RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and reserved blocks per RFC 5735 can be excluded to generate only routable addresses. The tool approximates a uniform distribution over the selected class space, but note that real-world BGP routing tables allocate addresses non-uniformly. Results include optional CIDR prefix length for subnet testing.
Formulas
An IPv4 address is a 32-bit unsigned integer rendered as four decimal octets separated by dots. Each octet Oi satisfies 0 β€ Oi β€ 255. The full address space contains 232 = 4,294,967,296 possible addresses.
Where O1, O2, O3, O4 β [0, 255].
Network class is determined by the leading bits of O1:
The number of host addresses in a subnet with prefix length p is:
The subtraction of 2 accounts for the network address (all host bits 0) and broadcast address (all host bits 1).
Reference Data
| Class | First Octet Range | Default Subnet Mask | CIDR Prefix | Network Bits | Host Bits | Max Networks | Max Hosts/Network | Purpose |
|---|---|---|---|---|---|---|---|---|
| A | 1 - 126 | 255.0.0.0 | /8 | 8 | 24 | 126 | 16,777,214 | Large organizations |
| B | 128 - 191 | 255.255.0.0 | /16 | 16 | 16 | 16,384 | 65,534 | Medium organizations |
| C | 192 - 223 | 255.255.255.0 | /24 | 24 | 8 | 2,097,152 | 254 | Small networks |
| D | 224 - 239 | N/A | /4 | 4 | 28 | N/A | N/A | Multicast |
| E | 240 - 255 | N/A | /4 | 4 | 28 | N/A | N/A | Experimental/Reserved |
| RFC 1918 Private Address Ranges | ||||||||
| A (private) | 10.x.x.x | 255.0.0.0 | /8 | 8 | 24 | 1 | 16,777,214 | Corporate intranets |
| B (private) | 172.16 - 172.31 | 255.240.0.0 | /12 | 12 | 20 | 16 | 1,048,574 | Campus networks |
| C (private) | 192.168.x.x | 255.255.0.0 | /16 | 16 | 16 | 256 | 65,534 | Home/small office |
| RFC 5735 Special-Purpose Ranges | ||||||||
| - | 0.0.0.0/8 | - | /8 | - | - | - | - | βThisβ network |
| - | 100.64.0.0/10 | - | /10 | - | - | - | - | Carrier-grade NAT (RFC 6598) |
| - | 127.0.0.0/8 | - | /8 | - | - | - | - | Loopback |
| - | 169.254.0.0/16 | - | /16 | - | - | - | - | Link-local (APIPA) |
| - | 192.0.0.0/24 | - | /24 | - | - | - | - | IETF Protocol Assignments |
| - | 192.0.2.0/24 | - | /24 | - | - | - | - | TEST-NET-1 (documentation) |
| - | 198.51.100.0/24 | - | /24 | - | - | - | - | TEST-NET-2 (documentation) |
| - | 203.0.113.0/24 | - | /24 | - | - | - | - | TEST-NET-3 (documentation) |
| - | 198.18.0.0/15 | - | /15 | - | - | - | - | Benchmarking (RFC 2544) |
| - | 255.255.255.255/32 | - | /32 | - | - | - | - | Limited broadcast |