One hundred and twenty-eight bits
An IPv6 address is eight groups of four hex digits separated by colons, 128 bits total. 2001:0db8:0000:0000:0000:0000:0000:0001 is the long form; 2001:db8::1 is the compressed one. Two rules govern compression: a run of zero groups becomes a double colon, which may appear only once per address or the count of zeros becomes ambiguous, and leading zeros inside a group are dropped, so 0db8 becomes db8. RFC 5952 further requires compressing the longest zero run, leftmost on a tie, never a single zero group, and lowercase hex. That is why exactly one canonical form exists.
Steps
- Enter an address such as 2001:db8::1 in any case.
- Click Parse for validity, the expanded eight groups, the RFC 5952 form and the address type.
- Expanded view shows each group padded to four digits; Compressed view returns the short form.
- Example loads a standard address, Download saves output and Clear resets.
How the type is decided
The prefix alone decides: 2000 through 3fff is global unicast where public addresses live; fe80 prefixes are link-local and valid only on one link, common in router advertisements; fc00 through fd00 are unique local, the IPv4 private-range analogue used in enterprise networks; ff00 prefixes are multicast; ::1 is loopback, the equivalent of 127.0.0.1. Embedded IPv4 forms like ::ffff:192.168.1.1 exist for transition mapping and get labelled separately.
Why validation fails
A second double colon is the most common error and is rejected outright, since the omitted group count is unknowable. More than eight groups also fails, as does a group of five or more hex digits like 2001:db8:12345::. Bracketed forms such as [2001:db8::1] belong in URLs and may fail here until brackets are removed. Full-width colons copied from documents are invisible to the eye and cause baffling failures, so check characters first.
Why canonical form matters
Log comparison, deduplication and config checks all assume one address yields one string, otherwise 2001:DB8::1 and 2001:db8:0::1 count as two. RFC 5952 exists to settle the compression style, casing and zero groups. Do not hand-write your own regex for validation either, since edge cases leak; verifying against a tool is more reliable.