Reading and Shortening IPv6 Addresses
Learn the hexadecimal format and the rules for compressing it.
Reading and Shortening IPv6 Addresses is a free Network+ Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Network+ Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Eight Groups of Hex
An IPv6 address is 128 bits written as eight groups of four hexadecimal digits, separated by colons. Each group represents 16 bits, and eight times 16 is 128.
An example is 2001:0db8:0000:0000:0000:ff00:0042:8329. The colons replace the dots used in IPv4 notation.
2001:0db8:0000:0000:0000:ff00:0042:8329Hexadecimal Recap
IPv6 uses hexadecimal (base 16), with digits 0-9 and letters a-f. The letter a equals 10, b is 11, up to f which is 15.
Each hex digit represents 4 bits, so four hex digits make 16 bits — one group. Hexadecimal keeps the long 128-bit address compact and human-readable.
Rule 1: Drop Leading Zeros
The first shortening rule removes leading zeros within each group. The group 0db8 becomes db8, and 0042 becomes 42.
Only leading zeros go; a group of all zeros (0000) shortens to a single 0. You cannot remove trailing or middle zeros, only those at the front of a group.
Rule 2: The Double Colon
The second rule replaces one run of consecutive all-zero groups with a double colon (::). The :: stands in for as many zero groups as needed to total eight.
So 2001:db8:0:0:0:ff00:42:8329 becomes 2001:db8::ff00:42:8329, collapsing three zero groups into ::.
Double Colon Used Once
The :: may appear only once in an address. If it appeared twice, you could not tell how many zero groups each :: represents, making the address ambiguous.
When two separate zero runs exist, choose to collapse the longer one with :: and write the other run out as explicit 0 groups.
A Full Worked Example
Start with 2001:0db8:0000:0000:0000:0000:0000:0001.
- Drop leading zeros: 2001:db8:0:0:0:0:0:1
- Collapse the zero run: 2001:db8::1
The shortened form is far easier to read and write while representing the exact same 128-bit value.
Expanding a Short Address
To expand, reverse the rules. For 2001:db8::1, count the groups present (2001, db8, 1 = three groups) and the :: fills the missing 5 groups with zeros.
Restore leading zeros too: it becomes 2001:0db8:0000:0000:0000:0000:0000:0001. Being able to expand helps when comparing addresses exactly.
The Loopback Address
The IPv6 loopback is ::1, the equivalent of IPv4’s 127.0.0.1. Fully written it is 0000:0000:0000:0000:0000:0000:0000:0001.
The unspecified address, all zeros, shortens to simply :: and means "no address," used before a device has been assigned one.
Prefix Length Notation
IPv6 uses CIDR-style prefix length too, written with a slash. The prefix is the count of network bits, just as in IPv4.
A very common prefix is /64, where the first 64 bits identify the network and the last 64 bits identify the host (the interface). Most LANs use a /64.
Network and Interface Parts
A typical IPv6 address splits into a 64-bit network prefix and a 64-bit interface identifier. The interface ID often derives from the device’s MAC address or is randomized for privacy.
This clean /64 split simplifies addressing and supports SLAAC, letting devices build their own addresses from the advertised prefix.
Practice Makes Fluent
Reading IPv6 feels strange at first, but the two rules — drop leading zeros and collapse one zero run with :: — handle almost everything.
Practice shortening a few addresses by hand. Soon 2001:db8::1 will read as naturally as 192.168.1.1, and you will be ready to explore IPv6 address types.
Quick Check
Shorten the address.
Recap
You learned to read and shorten IPv6 addresses.
- IPv6 is 128 bits: eight groups of four hex digits, colon-separated.
- Rule 1: drop leading zeros in each group.
- Rule 2: collapse one run of zero groups with :: (only once).
- Loopback is ::1; unspecified is ::.
- A /64 prefix splits the address into network and interface halves.
Frequently asked questions
Is the “Reading and Shortening IPv6 Addresses” lesson free?
Yes — the full text of “Reading and Shortening IPv6 Addresses” is free to read here on the web, and the Network+ Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Network+ Academy course, upgrade to CoddyKit PRO.
What will I learn in “Reading and Shortening IPv6 Addresses”?
Learn the hexadecimal format and the rules for compressing it. You practise Network+ Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Network+ Academy?
No prior experience is required. Network+ Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Reading and Shortening IPv6 Addresses” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Network+ Academy lesson?
Yes. Every Network+ Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Why We Needed IPv6
- Reading and Shortening IPv6 Addresses
- IPv6 Address Types and Scopes
- Running IPv4 and IPv6 Together