Advertisement

Random IP Address Generator

Generate up to 1,000 random IPv4 or IPv6 addresses of exactly the kind you need — public, private, documentation, CGNAT or inside a subnet of your choice — in the format you paste them into, and check what type any IP address is.

Advertisement

What type of IP address is this?

Try:

Random public addresses may belong to real hosts: use them as data, never as targets. For examples and documentation, choose the documentation ranges.

Advertisement

Choose the right kind of random IP

TypeIPv4IPv6Use it for
PublicEverything outside the special-purpose blocksGlobal unicast 2000::/3 without the special-purpose blocksTesting IP parsing, geolocation lookups, rate limiting and log analysis
Private10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 (RFC 1918)fd00::/8 unique local (RFC 4193)LAN and VPC configurations, Docker and Kubernetes networks
Documentation192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 (RFC 5737)2001:db8::/32 (RFC 3849) and 3fff::/20 (RFC 9637)Docs, tutorials, screenshots, test fixtures
Carrier-grade NAT100.64.0.0/10 (RFC 6598)—Testing ISP and mobile-network scenarios
Loopback127.0.0.0/8::1Local services and allow-lists
Link-local169.254.0.0/16fe80::/10Auto-configuration when no DHCP server answers

For IPv4 the public option skips every special-purpose block in the IANA registry: “this network” (0.0.0.0/8), private, CGNAT, loopback, link-local, IETF protocol assignments (192.0.0.0/24), documentation, the old 6to4 relay (192.88.99.0/24), benchmarking (198.18.0.0/15), multicast (224.0.0.0/4), reserved (240.0.0.0/4) and broadcast. For IPv6 it stays in global unicast 2000::/3 and leaves out the IETF protocol assignments 2001::/23 (Teredo among them), both documentation ranges 2001:db8::/32 and 3fff::/20, and 2002::/16 (6to4). Note that most of 2000::/3 is not yet allocated to anyone, so random IPv6 addresses are realistic in format rather than in distribution.

Documentation addresses: the safe default

If you need IPs for a README, an API example, a blog post or a unit test, use the documentation ranges. They exist for that purpose and are never routed, so an example can never point at somebody’s real server. For IPv6 there are now two: the classic 2001:db8::/32 and, since 2024, the much larger 3fff::/20 (RFC 9637), which leaves room to document realistic multi-site networks. Random public addresses, on the other hand, may belong to real machines: treat them as data for parsers and analytics, never as something to connect to or scan.

Advertisement

Generate addresses inside a subnet

Choose Inside a subnet and enter a block such as 10.20.0.0/16, 192.168.1.0/24 or, for IPv6, 2001:db8:abcd::/48 to get random addresses from that network — to fill an inventory, test firewall rules or seed a DHCP lease table. A /24 holds 256 addresses, 254 of them usable hosts, and a /16 65,536; ask for more than the subnet holds and you get each one once. Usable hosts only (on by default) leaves out the network and broadcast addresses of IPv4 subnets up to /30. Tick Sort for numeric order.

Use cases

How the generator works

Every address comes from your browser’s cryptographic random number generator (crypto.getRandomValues). For public IPv4 addresses the generator draws a uniformly random 32-bit number and redraws whenever it falls into a special-purpose block, so all public addresses are equally likely. Subnet and IPv6 addresses take the network prefix and fill the host bits at random. Duplicates are removed, and nothing is sent to a server. To do the same in your own code:

# Python: one random public IPv4 address
import ipaddress, secrets
while not (ip := ipaddress.IPv4Address(secrets.randbits(32))).is_global:
    pass

# Python: a random host in a subnet
net = ipaddress.ip_network("10.20.0.0/16")
host = net[1 + secrets.randbelow(net.num_addresses - 2)]

// JavaScript (browser or Node 19+): a random IPv4 address
const ip = Array.from(crypto.getRandomValues(new Uint8Array(4))).join(".");

Frequently asked questions

Are random IP addresses real?

Random public addresses are valid and may be assigned to real devices. That is fine for testing parsers or analytics, but don’t connect to them, scan them or publish them as examples. Documentation, private and loopback addresses never point at anyone else’s host.

Can a random IP address hide or change my IP?

No. Generating addresses doesn’t change the IP your connection uses; websites still see your real address. Hiding it takes a VPN, a proxy or Tor. Sending packets with a forged source address doesn’t work for normal web traffic either, because the replies go to the forged address.

Which IP address should I use in documentation?

Use 192.0.2.0/24, 198.51.100.0/24 or 203.0.113.0/24 for IPv4 and 2001:db8::/32 or 3fff::/20 for IPv6. Avoid invented public addresses such as 1.2.3.4, which belong to real networks.

What are IP address classes A to E?

The pre-1993 split by first octet: A (0–127), B (128–191), C (192–223), D (224–239, multicast) and E (240–255, reserved). CIDR replaced classes long ago, so the class says nothing about the real network size, but the checker shows it because exams and older documentation still use it.

Is this an IP address generator for assigning IPs to devices?

No. Devices get their addresses from DHCP or static configuration on your network. This tool generates addresses as data — for tests, documentation and configuration examples — and the subnet option is the closest match for planning: it shows random addresses that fit a block.

Can I add ports or change the output format?

Yes. Tick Add a random port for address:port pairs (IPv6 as [address]:port), and choose one per line, comma- or space-separated, a JSON array or a quoted list for SQL.

Related tools

Advertisement