IPv6 address format: read, shorten and validate an address

Understand IPv6 address format with expanded and compressed examples, prefixes, scoped addresses, URL brackets and common copying mistakes.

Published:

Read the IPv6 address format

The IPv6 address format represents a 128-bit value using hexadecimal digits and colon separators. A fully expanded address has eight groups of four digits. Each group contains sixteen bits. Letters from a through f represent values above nine, so an address such as 2001:db8::42 is not a damaged version of a dotted IPv4 address.

For a practical check, paste a bare address into IP lookup. The result separates normalized notation, address family and scope from any available registry information. Understanding the notation helps you compare that result with device settings without assuming that different-looking strings describe different network endpoints.

Start with this expanded documentation example:

2001:0db8:0012:0000:0000:0000:0000:0042

Read the colons as group boundaries. Do not read the groups as decimal numbers or interpret every pair of digits as a separate device identifier. The IPv6 address format describes a numeric address; it does not contain a universally decodable person's name, street address or physical device model. Addressing architecture

The examples beginning with 2001:db8 use a range reserved for documentation. They teach syntax and arithmetic; they are not live destinations for a connectivity test. When practicing address compression, keep example values separate from an address actually assigned to your network. Documentation prefix

Shorten and expand the notation

Leading zeroes inside a group can be omitted. The group 0042 becomes 42, while 0db8 becomes db8. Removing a trailing zero would change the value: 1200 cannot become 12. This is the first useful distinction when comparing an expanded address with the shorter output of a command or diagnostic page.

One consecutive run of zero groups can be replaced with ::. It can appear only once, so the number of omitted groups remains unambiguous. In IPv6 address format, 2001:db8:12::42 expands to the eight-group example above: three groups before the abbreviation, one afterward, and four zero groups inserted between them.

For consistent display, the canonical recommendations use lowercase, remove leading zeroes, compress the longest eligible zero run, and choose the first run when equal lengths tie. A single zero group stays written as 0 in canonical output. These rules standardize the presentation; they do not create a different address. Text representation recommendations

Work through an address comparison

Compare 2001:0db8:0012:0000:0000:0000:0000:0042 with 2001:db8:12::42. Expand the short form before comparing groups. Both have the same eight numeric values, so they identify the same address. A text search that compares characters alone can miss that equality. Use an address-aware parser to compare the numeric values when the distinction matters for configuration or reporting.

Next compare 2001:db8:12::42 with 2001:db8::12:42. Both use valid notation, but their expanded groups differ. Moving the double colon changes where the omitted zeroes belong. Do not “tidy” an unfamiliar address by relocating separators; copy the value exactly and let a parser normalize its representation.

Finally, 2001:db8::12::42 is ambiguous and invalid. The two abbreviations do not tell a reader how many zero groups belong in either position. If a copied address is rejected, check punctuation before assuming there is a network outage. Validation can fail without sending a single packet.

Prefixes and scope

The suffix in 2001:db8:12::42/64 is a prefix length. It says that sixty-four leading bits belong to the network prefix. It does not say there are sixty-four devices, and it is not a port number. IPv6 address format and prefix notation answer related but different questions: one identifies the value, while the other describes a boundary.

Use the CIDR guide and subnet calculator to inspect that boundary. The containing network for the example is 2001:db8:12::/64. A field asking for one bare address may reject the slash suffix even though the combined address-and-prefix form is appropriate in another configuration screen. Match the notation to the field's purpose before removing information.

Similar spelling, different reach

A link-local address is meaningful on its attached link. You will often see a value beginning with fe80 in device settings. That observation does not demonstrate a working public connection. A unique local address is another category with different routing expectations. Its hexadecimal appearance alone does not make it a public internet destination. Unique local addresses

The unspecified value :: and loopback value ::1 also use valid IPv6 address format. They do not identify an ordinary remote public host. Software may display them in configuration or listener output for reasons specific to that context. Record the field name and application rather than interpreting any syntactically valid value as your website-visible source.

Addresses do not become reachable because their spelling is valid. A configured global address still needs a usable route, appropriate policy and a working destination. Use the IPv6 test for a separate browser observation. IPv6 address format validation checks the text and number; the test checks whether a specific request succeeds.

Zone identifiers and local context

A local command may show fe80::42%en0 or a numeric suffix after the percent sign. The suffix identifies a zone or interface context for a scoped address. It is local to that system and is not part of the 128-bit number. Another device can use a different identifier. Scoped address architecture

Our public lookup deliberately rejects zone identifiers. That does not make the entire scoped notation invalid in the operating system that produced it. When working with scoped addresses, distinguish the requirements of a local command from those of a public lookup. Removing the suffix would not make a link-local destination reachable from this website.

Addresses in URLs and logs

In a URL authority, square brackets separate an IPv6 literal from a following port. The documentation example https://[2001:db8::42]:8443/ has a bracketed address, port 8443, and a path beginning with /. The brackets belong to that URL syntax rather than to the address value itself. URI syntax

An IP input here expects the bare IPv6 address format, such as 2001:db8::42. Do not paste the scheme, brackets, port and path into a field that asks only for an address. Conversely, when using a URL field, do not remove required punctuation merely to imitate a bare-address example from another tool.

Some logs represent IPv4 peers with a mapped value such as ::ffff:192.0.2.42. That representation is not proof of a native IPv6 connection. This site's parser normalizes mapped peers to their IPv4 address for classification. Reading an address in a log therefore needs the socket and application context as well as the visible characters.

Validate the input before changing settings

Start by copying the complete value into a plain text field. Check for invisible spaces, a truncated selection, a colon mistaken for a semicolon, or an ellipsis inserted by a display. An address shown across two visual lines can still be one value; a literal space or omitted group changes what a parser receives.

Then identify the input expected by the destination: bare address, address with prefix, URL, or local scoped address. Preserve that context in a support report. A rejection by one form does not prove that the operating system's notation is malformed. The IPv6 address format may simply contain information that this particular input does not accept.

After validation, compare normalized numeric values before calling a difference an address change. Only then investigate assignment, temporary addressing, VPN behavior or routing. This order avoids modifying a working network because one screen uses uppercase or shows more zeroes. A normalized value is a useful comparison aid, not a diagnosis of the connection.

Questions about notation

Can the address contain letters outside a–f? Ordinary hexadecimal groups cannot. An interface suffix can contain other characters, but it is separate context. If the bare IPv6 address format includes a letter such as g, review the copied input rather than guessing a replacement.

Does a shorter address have fewer bits? No. Compression changes the text length while retaining the same 128-bit value. In IPv6 address format, the omitted zero groups can be reconstructed. The short display does not mean the network allocated a smaller address family.

Does a valid address prove IPv6 works? No. Syntax, local configuration and live reachability are separate observations. If the browser test fails, use IPv6 not detected to investigate the relevant path. Keep the syntax check with the result, without substituting it for a connection measurement.

IPv6 address format: read, shorten and validate an address — common questions

Can one address contain two double-colon sequences?

A bare address cannot use two separate double-colon compressions because the omitted group counts would be ambiguous. Expand the groups and check the original source rather than guessing how many zeroes each sequence represents.

Are uppercase and lowercase hexadecimal letters different addresses?

No. Letter case changes the spelling, not the numerical value. Compare normalized values when one interface uses uppercase and another uses lowercase before describing the difference as a reassignment.

Can I remove every leading zero in a group?

Leading zeroes can be omitted, but a zero-valued group still needs a representation unless it belongs to the single compressed sequence. Preserve the group boundaries and validate the complete value afterward.

Why does a literal address need brackets in a URL?

Brackets distinguish the address's colons from URL syntax, including the optional port separator. Use the form expected by the URL field; a bare-address lookup and a complete URL are different inputs.

Where does a port number go beside an IPv6 URL?

The port follows the closing bracket, rather than becoming another address group. Keep the URL's scheme, host brackets, and port syntax distinct when copying an endpoint from a log or configuration.

Does the percent sign suffix belong to the global address?

A zone identifier supplies local interface context for scoped use. It is not extra globally routable address bits. Preserve it for the appropriate local task, but do not assume every public lookup accepts it.

Is the slash suffix part of the 128-bit host value?

The slash introduces a prefix length. It describes a range or interface configuration context rather than extending the address. Check whether the destination field expects a bare value or a value with a prefix.

How can I tell whether compression changed the actual number?

Expand or normalize both values, then compare their address bits. Only after establishing a numerical difference should you investigate temporary addressing, assignment changes, VPN behavior, or another interface.