Network and IP Planning · #02

Online IPv6 Prefix and Address Normalizer

Converts an IPv6 address to the standard compressed and full forms and shows the prefix's first and last address, capacity and scope.

  • Data is processed in your browser and not sent to a server

Tool

Compressed, full or mixed notation; optional /prefix

0–128. Leave empty if the address has a /prefix.

What does this tool do?

The same IPv6 address can be written in many ways. In firewall rules, DNS records and inventories that makes one address look like several, and comparisons fail silently. The tool converts the address to the single canonical form recommended by RFC 5952 and calculates the prefix boundaries with full 128-bit integer precision.

How to use it

  1. Enter the address. Give the prefix with the address (/64) or in the separate field; if both are given they must match.
  2. Zone IDs (fe80::1%eth0) and embedded IPv4 (::ffff:192.0.2.1) are supported.
  3. Press Calculate. Without a prefix, /128 is assumed.

Fields

IPv6 address
Compressed, full or mixed notation; optional /prefix
Prefix length (optional)
0–128. Leave empty if the address has a /prefix.

Worked example

InputValue
IPv6 address2001:0db8:0:0:0:0:0:1/64

Expected result: Compressed 2001:db8::1, full 2001:0db8:0000:0000:0000:0000:0000:0001, prefix 2001:db8::/64, capacity 18,446,744,073,709,551,616 addresses.

The longest run of zero groups becomes ::, leading zeros are dropped and letters are lower case. 2001:db8::/32 is the documentation range (RFC 3849) and is not used on real networks.

Second scenario

InputValue
IPv6 address::FFFF:192.0.2.128

Expected result: ::ffff:192.0.2.128 — an IPv4-mapped address; the embedded IPv4 is shown as 192.0.2.128.

Method and assumptions

The address is converted to a 128-bit integer (BigInt), so it does not hit the 53-bit limit of JavaScript numbers. The prefix network is address AND mask, the last address is network OR host mask.

Canonical form per RFC 5952 §4: lower case, no leading zeros, the longest run of at least two zero groups becomes ::, the first run wins a tie, a single zero group is not compressed. IPv4-mapped addresses are written as ::ffff:a.b.c.d.

IPv6 has no broadcast address; the last address of a prefix is not a broadcast. The scope label is derived from ::/128, ::1, fe80::/10, fc00::/7, ff00::/8, 2001:db8::/32 and 2000::/3.

Using the result and troubleshooting

Use the canonical form in inventories, firewall objects and when comparing DNS records, so each address is searched in one form.

Use /64 on end networks; SLAAC and many devices assume /64. The tool warns for prefixes longer than /64; /127 on point-to-point links (RFC 6164) is a special case.

Limits and common mistakes

  • It does not query whether the address is routed or allocated.
  • The zone ID is shown but not used in the calculation.

Frequently asked questions

Why is 2001:db8:0:0:1:0:0:1 written as 2001:db8::1:0:0:1?

Both zero runs are equally long (two groups each). RFC 5952 recommends compressing the first run in a tie.

How many /64s are in a /48?

216 = 65,536. The tool shows this number for prefixes of /64 and shorter.

Related tools and service

  • IPv4 Subnet CalculatorCalculates the network address, broadcast, mask and usable host range of a single IPv4 network.
  • CIDR AggregatorReduces a CIDR list to the smallest number of prefixes that cover exactly the same addresses.

Related service: Enterprise Network Consulting

Network online tools · See all online tools