Eight groups, and the three rules that shorten them
An IPv6 address is 128 bits written as eight groups of four hex digits separated by colons. Three shortening rules apply, and they compose:
- Leading zeros inside a group are dropped.
0db8becomesdb8,0000becomes0. Trailing zeros are never dropped —db80stays as it is. - One run of consecutive all-zero groups may be replaced by
::. - The
::may appear at most once in an address.
The one-appearance rule is not arbitrary. :: means "as many zero groups as it takes to reach eight". With two of them in the same address, there is no way to divide the missing groups between them: 1::2::3 could be five zero groups then one, or one then five, or anything in between. Rather than pick a convention, the specification forbids it.
Legal is not the same as canonical
RFC 5952 exists because parsers accept far more spellings than people should write. It narrows the legal set to one canonical form per address, and the extra rules are the ones that catch people out. Hex digits are lowercase. The :: goes on the longest run of zero groups, not the first one you notice. When two runs are the same length, it goes on the leftmost. And :: must not stand for a single zero group — 2001:db8:0:1:1:1:1:1 is canonical, while 2001:db8::1:1:1:1:1 is legal but wrong by that rule, and is also one character longer, which shows how little the shortcut buys there.
None of this matters to a router. All of it matters to anything that compares addresses as text: allow lists, log deduplication, database unique constraints, cache keys. Two spellings of one address is two rows, two entries and two cache misses. Normalise on the way in and the problem disappears.
Prefix lengths that carry meaning
| Prefix | Usual role |
|---|---|
| /128 | A single address — a loopback, a host route, one entry in a rule |
| /127 | Point-to-point link between two routers, the IPv6 counterpart of a /31 |
| /64 | One LAN. Autoconfiguration assumes this and mostly stops working if it is longer |
| /56 | A common residential allocation — 256 separate /64 networks |
| /48 | A common site allocation — 65,536 /64 networks |
| /32 | Typical allocation to a provider |
The instinct carried over from IPv4 is to make subnets as small as the host count allows. That instinct is wrong here. A /64 is the unit, there are more of them than any site will use, and carving a /64 into /112s to "save space" saves nothing while breaking autoconfiguration, neighbour discovery expectations and a certain amount of vendor tooling. Number generously and stop thinking about address exhaustion inside your own site.
The reserved ranges you will actually meet
One range takes a different shape on purpose. An address inside ::ffff:0:0/96 carries an IPv4 address in its last 32 bits, and RFC 5952 says to write those 32 bits as a dotted quad — so ::ffff:192.0.2.128 is canonical and ::ffff:c000:280, which is the same 128 bits, is not. The rule applies to that block alone; the deprecated IPv4-compatible form with no ffff group is written entirely in hex.
fe80::/10 is link-local and is present on every IPv6 interface whether or not anything else is configured; it never routes off the link, and it is what neighbour discovery and default gateways use. fc00::/7 is unique local, the loose analogue of RFC 1918 space, and in practice the usable half is fd00::/8 with a randomly generated 40-bit site identifier. ff00::/8 is multicast, which does the job broadcast used to do — there is no broadcast address in IPv6 at all. 2001:db8::/32 is reserved for documentation, which is why it appears throughout this page and should never appear in a configuration.
A link-local address may need a zone identifier to be usable, written as fe80::1%eth0, because the same link-local address can exist on more than one interface of the same machine. The zone is local to that machine and means nothing anywhere else, so it is not part of the address and this tool reports it separately rather than folding it in.
Square brackets, ports and the URL problem
An address full of colons cannot go straight into a URL, because the colon before a port number would be ambiguous. The host part is wrapped in square brackets instead: http://[2001:db8::1]:8080/path. The brackets belong to the URL syntax, not to the address, so they are stripped for a configuration file and added back for anything URL-shaped. Certificates, log formats and connection strings each have their own opinion about which form they want, and mixing them up is a routine source of a connection that fails only over IPv6. If you are picking apart a URL that contains one, the URL parser splits it into its parts, and the port number lookup covers what usually sits behind a given port. Nothing on this page resolves a name or contacts an address — it converts notation, and that is all it does.
Questions people ask
Where exactly does the :: go when there are two runs of zeros?
On the longest run. If two runs are the same length, on the leftmost of them. In 2001:db8:0:0:1:0:0:1 both runs are two groups long, so canonical form is 2001:db8::1:0:0:1 — the double colon takes the earlier pair and the later pair stays written out as zeros. Getting this backwards produces an address that still parses to the same 128 bits but does not match the canonical string, which is the whole reason the rule exists.
Why can I not use :: twice to shorten two separate runs?
Because the notation would become ambiguous. The double colon means "enough zero groups to bring the total to eight", and that is only solvable when there is one of them. With two, the missing groups could be split between them in several ways and nothing in the address says which. The specification therefore allows exactly one, and every parser rejects a second one.
Is fe80::1 the same address on two different machines?
It can be, and that is normal. Link-local addresses are scoped to a single link, so the same one may exist on many links without conflict, which is why a zone identifier such as %eth0 is often required to say which interface you mean. The zone is meaningful only on the machine that writes it. Copying fe80::1%eth0 from one host to another and expecting it to point at the same thing does not work.
Can I use a prefix longer than /64 on a LAN?
It is legal, and it usually causes trouble. Stateless address autoconfiguration derives the host part from a 64-bit interface identifier and assumes the network part is 64 bits, so devices in a /112 will generally not configure themselves. Point-to-point links between routers are the accepted exception, where /127 is used deliberately and both ends are configured by hand. For anything with clients on it, use /64.
Does this tool check whether the address is reachable?
No. It performs no lookup and sends no traffic — the conversion is arithmetic on the text you typed, done inside the page. It cannot tell you whether an address is assigned, routed, in use or reachable, and a well-formed address here says nothing about any of those. What it can tell you is whether the address is syntactically valid, what its canonical spelling is, and which reserved range it falls in.