Quiz Entry - updated: 2026.07.05
Worked example: compress 2001:0db8:0000:1111:0000:0000:0000:0200 to its shortest valid form.
2001:db8:0:1111::200 — drop leading zeros, then collapse the longest run of zero hextets (hextets 5-7) with ::.
Step by step:
Start: 2001:0db8:0000:1111:0000:0000:0000:0200
Rule 1: 2001: db8: 0:1111: 0: 0: 0: 200 (drop leading zeros)
= 2001:db8:0:1111:0:0:0:200
Rule 2: collapse the longest zero run (the three 0 hextets, positions 5-7)
Result: 2001:db8:0:1111::200
Why not collapse the single 0 in hextet 3?
::should replace the longest run; using it on the lone0(e.g.2001:db8::1111:0:0:0:200) is shorter than the original but not the shortest, and::can be used only once.
Gotcha: 2001:db8:0:1111:0:0:0:200 cannot legally use :: in two places, so you must pick one run — choose the longest.
Go deeper:
IPv6 address — recommended representation (Wikipedia) — confirms the canonical form collapses the longest zero run (and the leftmost on a tie).