Random IPv6 Address Generator
Generate random IPv6 addresses with RFC 5952 compression, custom prefixes, and subnet support. Copy or export bulk addresses instantly.
About
IPv6 uses a 128-bit address space, yielding approximately 3.4 × 1038 unique addresses. Generating test addresses by hand is error-prone. A misplaced colon or an incorrect group count invalidates the address entirely, breaking firewall rules, DNS records, or ACL entries before they reach production. This generator produces cryptographically random addresses using the browser's native CSPRNG (crypto.getRandomValues), applies canonical compression per RFC 5952, and respects user-defined prefix lengths so output falls within a target subnet.
The tool does not simulate randomness with Math.random. It draws from the operating system's entropy pool. Addresses are formatted with zero suppression and longest-run :: collapsing. Limitation: generated addresses are syntactically valid but not guaranteed routable. They are intended for testing, documentation, and configuration templating.
Formulas
An IPv6 address consists of 8 groups of 4 hexadecimal digits separated by colons, totaling 128 bits:
Where each gi ∈ [0000, ffff] (16 bits). The total address space is 2128.
When a prefix of length p is specified, the first p bits are fixed and the remaining 128 − p bits are randomized. The number of possible addresses within that subnet is:
RFC 5952 canonical compression: (1) remove leading zeros from each group, (2) find the longest consecutive run of all-zero groups, (3) replace that run with ::. If two runs tie in length, the leftmost wins. The :: substitution may appear at most once.
Where addr = full IPv6 address, gi = the i-th 16-bit group, p = prefix length in bits, N = number of addresses in the subnet.
Reference Data
| Prefix | Range | Scope / Purpose | RFC | Prefix Length | Example |
|---|---|---|---|---|---|
| ::1 | Loopback | Host-only, equivalent to 127.0.0.1 | RFC 4291 | /128 | ::1 |
| :: | Unspecified | Absence of address | RFC 4291 | /128 | :: |
| fe80:: | Link-Local Unicast | Single link, auto-configured | RFC 4291 | /10 | fe80::1 |
| fc00:: | Unique Local (L=0) | Private, not yet assigned | RFC 4193 | /7 | fc00::1 |
| fd00:: | Unique Local (L=1) | Private, locally assigned | RFC 4193 | /8 | fd12:3456::1 |
| 2001:db8:: | Documentation | Examples and docs only | RFC 3849 | /32 | 2001:db8::1 |
| 2001:: | Teredo Tunneling | IPv6 over UDP/IPv4 | RFC 4380 | /32 | 2001::1 |
| 2002:: | 6to4 Relay | Automatic tunneling (deprecated) | RFC 3056 | /16 | 2002:c0a8::1 |
| 2000:: | Global Unicast | Public Internet routable | RFC 3587 | /3 | 2607:f8b0:4004::1 |
| ff00:: | Multicast | One-to-many delivery | RFC 4291 | /8 | ff02::1 |
| ff02::1 | All Nodes (Link) | All link-local nodes | RFC 4291 | /128 | ff02::1 |
| ff02::2 | All Routers (Link) | All link-local routers | RFC 4291 | /128 | ff02::2 |
| ::ffff:0:0 | IPv4-Mapped | IPv4 inside IPv6 socket | RFC 4291 | /96 | ::ffff:192.168.1.1 |
| 64:ff9b:: | NAT64 Well-Known | Stateful IPv4/IPv6 translation | RFC 6052 | /96 | 64:ff9b::192.0.2.1 |
| 100:: | Discard-Only | Black hole routing | RFC 6666 | /64 | 100::1 |
Frequently Asked Questions
crypto.getRandomValues), which draws entropy from the operating system's cryptographic random number generator. This is the same source used for TLS key generation and is far superior to Math.random(), which is a PRNG and not suitable for security-sensitive address generation.Uint16Array) and completes in under 50 ms for 1000 addresses on modern hardware. For larger datasets, generate multiple batches and export each as a text file.