IP Address Generator

Random IPv4 and IPv6 addresses for testing

Produces random IPv4 and IPv6 addresses with options for public, private (RFC 1918), loopback, or CIDR subnet-constrained ranges. Useful for network tool testing, firewall rule mocks, and synthetic log data. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What counts as a private IPv4 address?

RFC 1918 reserves three private ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Addresses in these blocks are not routable on the public internet and are safe to use freely in test data without affecting any real host.

This generator produces random IPv4 and IPv6 addresses for network testing. You can keep output inside the RFC 1918 private ranges, generate globally routable public addresses, or constrain everything to a specific CIDR subnet — so the addresses are structurally valid for the network environment you are modelling.

How it works

IPv4 generation creates four decimal octets (0–255), constrained by your selected mode:

Private (RFC 1918):  10.x.x.x   — 10.0.0.0/8
                     172.16-31.x.x — 172.16.0.0/12
                     192.168.x.x — 192.168.0.0/16
Loopback:            127.x.x.x
CIDR-constrained:    fix top /n bits, randomise host bits
Public:              globally routable range, skipping all reserved blocks

CIDR mode is the most useful for specific test environments: enter a block like 10.20.0.0/16, and every generated address keeps the top 16 bits fixed while randomising the lower 16 — so all output is valid for that subnet.

IPv6 generation produces eight random 16-bit groups in hexadecimal, then applies the canonical RFC 5952 compression: the longest consecutive run of all-zero groups is collapsed to :: and leading zeros within each group are dropped. The result is always a valid, properly abbreviated IPv6 address.

Use cases by mode

ModeWhen to use
Private (RFC 1918)Test data for internal services; safe — can’t route to real hosts
LoopbackLocalhost testing, mock service discovery
CIDR-constrainedPopulate a DHCP log, firewall rule, or specific lab subnet
PublicTest geolocation lookups, rate-limiter allow-listing, load balancer rules
IPv6Test dual-stack parsers, IPv6 firewall rules, modern network code

Common patterns for developers

Seeding synthetic access logs. Generating 1,000 random private IPs populates access logs for testing log-parsing pipelines without exposing real client addresses.

Testing firewall rules. CIDR mode lets you confirm an allow rule for 192.168.10.0/24 by generating 50 addresses from that subnet and verifying each is accepted, then generating addresses from 192.168.11.0/24 to confirm they are blocked.

Parser validation. IPv6 addresses come in many valid compressed forms. Generating a batch and feeding them through an IP parser or regular expression confirms the parser handles all canonical representations.

Load testing with realistic data. Public mode provides globally routable IPs for testing geolocation middleware, rate limiters keyed on IP, or CDN caching logic that behaves differently for different client origins.

All addresses are generated locally in JavaScript — nothing is sent to any server and the tool works fully offline.