DevTools Logo

Random IP Generator

Random IP Generator

IPv4/IPv6 fixtures — exclusions, CIDR scopes and bulk export

Runs in your browser

Configuration

100 addresses · IPv4/IPv6
IPv4 exclusions

Samples addresses with WebCrypto, filters them through RFC-cited exclusion ranges (private, loopback, link-local, CGNAT, multicast, documentation and reserved), or samples host bits inside an IPv4 CIDR scope. IPv6 addresses are rendered in RFC 5952 compressed form.

Generated addresses

No addresses generated

Configure and generate addresses

Exclusions and CIDR scoping apply before uniqueness.

Try an example

Examples

Public-only logs

Input
IPv4 · count 100 · all exclusion groups on
Output
100 addresses outside RFC 1918, loopback, multicast and reserved space

Safe-looking log fixtures that will not accidentally point at 127.0.0.1.

Subnet fixture

Input
CIDR 203.0.113.0/24 · documentation exclusion off · unique
Output
203.0.113.17, 203.0.113.204, …

Host bits are sampled uniformly inside the network; network and broadcast are skipped by default.

IPv6 lab

Input
IPv6 · compressed · ULA on · count 20
Output
fdxx:xxxx:…:xxxx

ULA scope keeps generated addresses in the private lab prefix.

About this tool

The Random IP Generator synthesizes IPv4 and IPv6 addresses for test fixtures. IPv4 values are drawn as four crypto-random octets and then filtered through RFC-cited exclusion ranges: RFC 1918 private space, loopback, link-local, CGNAT, multicast, documentation networks, benchmarking/reserved blocks and Class E. The exact share of remaining address space is computed by merging those ranges, so the number shown in the interface is authoritative rather than a guess.

CIDR mode samples a host value inside the masked network instead of the whole Internet. Network and broadcast addresses can be skipped (with honest notes for /31 and /32), and exclusions remain active: a private CIDR such as 192.168.1.0/24 is rejected with a clear explanation while RFC 1918 filtering is on, rather than silently yielding nothing.

IPv6 generation draws eight 16-bit groups and renders them either compressed per RFC 5952 — lowercase, no leading zeroes, longest zero-run collapsed — or expanded to eight padded groups. An optional ULA scope fixes the fd00::/8 prefix for private lab fixtures.

Batches are deduplicated when requested, with a saturation check against the available host space. Output can be copied as one address per line, CSV or JSON. This tool only writes fixture text: never probe, scan or target a generated public address, because it may belong to a real network.

What this tool does not do

  • Generated public addresses are not guaranteed unassigned; never target them.
  • CIDR scoping supports IPv4 only; IPv6 offers compressed/expanded formatting and ULA scoping instead.
  • Exclusions are a fixed, RFC-cited table; custom exclusion CIDRs are not part of this version.
  • IPv4-mapped IPv6 addresses (::ffff:) are not generated.

How to use this tool

  1. Pick protocol and count

    Choose IPv4, IPv6 or alternating mixed output and a count up to 10,000.

  2. Configure filtering

    Toggle RFC exclusion groups, optionally enter an IPv4 CIDR scope, and decide whether to skip network/broadcast addresses.

  3. Generate

    Press Generate addresses (or Mod+Enter); the panel header shows how much IPv4 space remains allowed.

  4. Export

    Select one-per-line, CSV or JSON, then Copy or download the file.

Use cases

Log parser fixtures

Seed realistic-looking access logs with varied public addresses without hitting loopback or private ranges.

Subnet test plans

Draw a sample of hosts from a specific network for firewall and inventory test cases.

Networking education

Show the difference between public, private, CGNAT and documentation space with concrete examples.

Generation modes

ModeBehavior
IPv4 unrestrictedFour random octets, rejected if any enabled exclusion range matches.
IPv4 CIDRRandom host bits inside the masked network; network/broadcast skipped when selected.
IPv6 compressedEight groups with RFC 5952 :: compression (e.g. 2001:db8::1).
IPv6 expandedEight colon-separated groups, each padded to four hex digits.
MixedAlternates IPv4 and IPv6 so parsers see both families.
CSV / JSONOne `ip` column or an array of {ip} objects.

Exclusions apply to IPv4 only; IPv6 modes offer ULA scoping instead.

Common mistakes

Mistake:Probing addresses that the tool generated.

Fix:Never scan or connect to them: a syntactically public address can belong to a real host. Mock network I/O in tests instead.

Mistake:Expecting a private CIDR to work with default exclusions.

Fix:Disable the matching exclusion group (for example RFC 1918) when sampling inside private space; the tool explains the conflict.

Mistake:Requesting more unique hosts than a CIDR can supply.

Fix:Read the saturation check: widen the prefix (smaller prefix number) or turn off uniqueness.

Frequently asked questions

Are generated IPs safe to use in tests?

They are safe as inert fixture data — for log lines, parser input or screenshots — but a syntactically public address may belong to a real network. Never probe, scan, ping or send traffic to them; mock network I/O instead. The documentation-range exclusion is available if you want addresses reserved specifically for examples.

Why exclude private ranges by default?

Because fixtures that accidentally contain 127.0.0.1 or 10.x addresses behave differently from production traffic and can trip parsers or policies in misleading ways. The default set excludes RFC 1918 space, loopback, link-local, CGNAT, multicast, Class E and reserved/documentation blocks. The interface shows the exact share of IPv4 space still available, computed by merging those ranges.

How does CIDR sampling work?

Enter a network such as 203.0.113.0/24. The tool masks the prefix and draws uniformly from the host bits, then composes the result with the network part. Network and broadcast addresses are skipped by default; /31 and /32 are handled with explicit notes rather than meaningless broadcast rules. Exclusions still apply, so a private CIDR requires disabling the corresponding exclusion group.

Can I generate IPv6 in compressed form?

Yes. The default IPv6 format is RFC 5952 compressed: lowercase hex, no leading zeroes, and the longest run of at least two zero groups replaced by :: (for example 2001:db8::1). Expanded mode emits all eight zero-padded groups. ULA scope fixes the fd00::/8 prefix for lab fixtures.

Are these real routable addresses?

The bytes are random; whether an address is actually routed is unknown and irrelevant for fixture use. Exclusion filters remove special-purpose ranges, but they cannot certify that a public address is unassigned. Treat every output as fictional data and never connect to it.

What happens if I request more unique addresses than the scope holds?

Generation stops with a saturation error that names the number of available hosts. For example, a /30 has four addresses (two usable for ordinary subnets), so asking for ten unique hosts cannot succeed. Widen the CIDR prefix or turn off uniqueness; the tool never silently emits duplicates in unique mode.

References & standards