User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
1 – 10,000
Presets:

  
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

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.

ipv4 generator random ip address ip address generator network tools ipv4 class cidr notation bulk ip generator

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.

IP = O1 β‹… 224 + O2 β‹… 216 + O3 β‹… 28 + O4

Where O1, O2, O3, O4 ∈ [0, 255].

Network class is determined by the leading bits of O1:

{
Class A: O1 ∈ [1, 126] - leading bit 0Class B: O1 ∈ [128, 191] - leading bits 10Class C: O1 ∈ [192, 223] - leading bits 110Class D: O1 ∈ [224, 239] - leading bits 1110Class E: O1 ∈ [240, 255] - leading bits 1111

The number of host addresses in a subnet with prefix length p is:

H = 2(32 βˆ’ p) βˆ’ 2

The subtraction of 2 accounts for the network address (all host bits 0) and broadcast address (all host bits 1).

Reference Data

ClassFirst Octet RangeDefault Subnet MaskCIDR PrefixNetwork BitsHost BitsMax NetworksMax Hosts/NetworkPurpose
A1 - 126255.0.0.0/882412616,777,214Large organizations
B128 - 191255.255.0.0/16161616,38465,534Medium organizations
C192 - 223255.255.255.0/242482,097,152254Small networks
D224 - 239N/A/4428N/AN/AMulticast
E240 - 255N/A/4428N/AN/AExperimental/Reserved
RFC 1918 Private Address Ranges
A (private)10.x.x.x255.0.0.0/8824116,777,214Corporate intranets
B (private)172.16 - 172.31255.240.0.0/121220161,048,574Campus networks
C (private)192.168.x.x255.255.0.0/16161625665,534Home/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

Frequently Asked Questions

Math.random uses a PRNG (typically xorshift128+) that is not cryptographically secure and can produce predictable sequences. crypto.getRandomValues draws from the OS entropy pool, producing uniformly distributed bytes suitable for security testing and unbiased address sampling across the 232 address space.
Class A spans O1 ∈ [1, 126]. The private block 10.0.0.0/8 and loopback 127.0.0.0/8 are removed. This still leaves 124 first-octet values (1 - 9, 11 - 126), yielding over 2 billion routable Class A addresses. The generator re-rolls any address that falls into an excluded block.
No. Class D (224.0.0.0 - 239.255.255.255) is reserved for IP multicast per RFC 5771. Class E (240.0.0.0 - 255.255.255.255) is reserved for experimental use per RFC 1112. Most routers will drop packets with these source addresses. Generating them is useful for firewall rule testing and IDS signature validation.
Appending a CIDR prefix (e.g., /24) does not modify the random IP itself. It annotates the address with subnet context. The number of usable host addresses in that subnet is 2(32 βˆ’ p) βˆ’ 2. For /24, that is 254 hosts. The prefix is appended as a string suffix to each generated address.
Yes. The generator produces syntactically valid, potentially routable IPv4 addresses. Never use generated addresses to send packets, configure DNS records, or populate ACLs without verifying ownership via ARIN/RIPE WHOIS lookups. For safe testing, enable the "Exclude Reserved" option and use addresses from TEST-NET blocks (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24) which are guaranteed non-routable per RFC 5737.
The generator supports up to 10,000 addresses per batch. Generation of 10,000 IPs with all filters active completes in under 50ms on modern hardware. The bottleneck is DOM rendering, which uses a DocumentFragment for batch insertion. Above 5,000 addresses, the output area becomes a scrollable container to prevent layout reflow.