Random IP Address Generator
Generate random IPv4 and IPv6 addresses with class filtering, CIDR notation, private range exclusion, and bulk export. Cryptographically random.
About
Generating random IP addresses is a routine requirement in network testing, firewall rule validation, database seeding, and security research. A poorly randomized dataset introduces bias: clustering around specific subnets, accidental collisions with reserved ranges like 10.0.0.0/8 or 192.168.0.0/16, or generating link-local addresses that break routing simulations. This tool uses crypto.getRandomValues for uniform distribution across the full 232 IPv4 space or 2128 IPv6 space, with optional filtering by address class (A through E) and automatic exclusion of private, loopback, and reserved blocks per RFC 5735 and RFC 6890.
Note: generated addresses are statistically random but not guaranteed globally routable. If you need addresses that resolve to real hosts, this tool is not appropriate. For load-testing or log fabrication, batch sizes up to 10,000 are supported with Set-based deduplication. CIDR prefix lengths are optionally appended for subnet simulation. IPv6 output supports both full and compressed (RFC 5952) notation.
Formulas
An IPv4 address is a 32-bit unsigned integer rendered as 4 dot-separated octets. Each octet Oi is drawn uniformly from [0, 255]:
where Oi ∈ {0, 1, …, 255} and class constraints restrict O1: Class A ∈ [1, 126], Class B ∈ [128, 191], Class C ∈ [192, 223], Class D ∈ [224, 239], Class E ∈ [240, 255].
An IPv6 address is a 128-bit value rendered as 8 colon-separated 16-bit hextets:
where each hextet Hi ∈ [0, 65535]. The total address space is 2128 ≈ 3.4 × 1038. CIDR notation appends /n where n is the prefix length in bits. The number of host addresses in a subnet is 2(total bits − n).
Reference Data
| Range / Block | CIDR | Type | First Octet | RFC | Routable |
|---|---|---|---|---|---|
| 0.0.0.0 - 0.255.255.255 | 0.0.0.0/8 | "This" Network | 0 | RFC 1122 | No |
| 10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 | Private (Class A) | 10 | RFC 1918 | No |
| 100.64.0.0 - 100.127.255.255 | 100.64.0.0/10 | Shared / CGN | 100 | RFC 6598 | No |
| 127.0.0.0 - 127.255.255.255 | 127.0.0.0/8 | Loopback | 127 | RFC 1122 | No |
| 169.254.0.0 - 169.254.255.255 | 169.254.0.0/16 | Link-Local | 169 | RFC 3927 | No |
| 172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 | Private (Class B) | 172 | RFC 1918 | No |
| 192.0.0.0 - 192.0.0.255 | 192.0.0.0/24 | IETF Protocol | 192 | RFC 6890 | No |
| 192.0.2.0 - 192.0.2.255 | 192.0.2.0/24 | Documentation (TEST-NET-1) | 192 | RFC 5737 | No |
| 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 | Private (Class C) | 192 | RFC 1918 | No |
| 198.18.0.0 - 198.19.255.255 | 198.18.0.0/15 | Benchmarking | 198 | RFC 2544 | No |
| 198.51.100.0 - 198.51.100.255 | 198.51.100.0/24 | Documentation (TEST-NET-2) | 198 | RFC 5737 | No |
| 203.0.113.0 - 203.0.113.255 | 203.0.113.0/24 | Documentation (TEST-NET-3) | 203 | RFC 5737 | No |
| 224.0.0.0 - 239.255.255.255 | 224.0.0.0/4 | Multicast (Class D) | 224 - 239 | RFC 5771 | No |
| 240.0.0.0 - 255.255.255.254 | 240.0.0.0/4 | Reserved (Class E) | 240 - 255 | RFC 1112 | No |
| 255.255.255.255 | 255.255.255.255/32 | Broadcast | 255 | RFC 919 | No |
| ::1/128 | ::1/128 | IPv6 Loopback | - | RFC 4291 | No |
| fc00::/7 | fc00::/7 | IPv6 Unique Local | - | RFC 4193 | No |
| fe80::/10 | fe80::/10 | IPv6 Link-Local | - | RFC 4291 | No |
| ff00::/8 | ff00::/8 | IPv6 Multicast | - | RFC 4291 | No |
| ::ffff:0:0/96 | ::ffff:0:0/96 | IPv4-Mapped IPv6 | - | RFC 4291 | No |