IPv6 Address Formats

This Standard describes how to represent IPv6 addresses in the UI in a way that is easy for users to parse.


Text Representation

  • For a Global Unicast address, use the IPv6 address prefix allocated for documentation purposes:
  • For a Link Local address, use any valid Link Local range. For example:
  • Use /64 for the subnet prefix
  • Use the canonical text representation format:
    • Remove leading zeros (0db8 becomes db8)
    • Compress contiguous zeros in the 16-bit segments (2001:db8:0000:0000:0000:0000:1 becomes 2001:db8::1)
    • Use lowercase for hex digits
  • In a Link Local address, if a zone index is needed, append the index to the address, separated by a percent sign (%). Don't display the default zone index.
  • If the address also contains a port number, enclose the address in square brackets ([]).  This notation avoids confusion between the colons characters (:) that separate the address from the colon that separates the port number.

IPv6 Text Box

  • Use a standard text box for an IPv6 address. Don't use a formatted pattern because users might copy the IP address into the text box.
  • Be flexible with accepting IPv6 formats. Users are likely to enter IPv6 addresses in a variety of formats.  For example:
    Full format 2001:db8:0000:0000:0000:0000:1
    Condensed format 2001:db8::1
    Subnet prefix 2001:db8:1ced:f00d::/64
    Port number [2001:db8:1ced:f00d::1]:443
  • Support mixed IPv6 and IPv4 notation. In this example, the final 32 bits are in IPv4 notation.
  • If the IPv6 address and prefix are known, prepopulate the text input box.
  • If the IPv6 address is for a host's local network device, prepopulate the prefix length field with 64.
  • Ignore invalid characters upon input.
  • On validation, convert uppercase hex digits to lowercase, remove leading zeros, and compress contiguous zeros.
  • If space allows, provide separate text input boxes for the address and subnet prefix.
  • Don't explain the various IPv6 formats directly in the UI. Instead, ensure that the application checks for the canonical format.

Mixed IP Address Types

  • If users can enter either an IPv6 address, IPv4 address, or host name into a text input box, ensure that validation checks for all notations.  A text box that accepts host name cannot support character restriction.
  • In a list or datagrid that includes both IPv6 and IPv4 addresses:
    • Allow IPv4 dotted-decimal format (
    • Perform sort and find operations on the "condensed" version of the addresses

Related Patterns

Average (0 Votes)