IPv6 to Hex Converter

Parses a full or '::'-compressed IPv6 address, expanding the compression to all 8 groups, and outputs the address's raw 128-bit value as 32 continuous hexadecimal digits with no colons. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

IPv6 addresses are usually written in their friendly colon-separated, '::'-compressed form, but the address itself is really just a 128-bit number underneath.

This tool expands that friendly form back into its raw 128-bit value, shown as 32 continuous hex digits, useful whenever you need the address in a flat, colon-free representation.

What Is IPv6 to Hex Converter?

A parser and converter that takes any valid full or '::'-compressed IPv6 address and outputs its underlying 128-bit value as 32 uppercase hex digits with no separators.

It fully expands the '::' zero-compression shorthand defined in the IPv6 addressing standard (RFC 4291) before producing the flat hex output.

How IPv6 to Hex Converter Works

The address is split on '::' if present, giving a head list and tail list of explicit groups; the number of missing groups (8 minus the explicit count) is filled with zero groups in between.

Each of the resulting 8 groups is validated as 1-4 hex digits, zero-padded to exactly 4 digits, and all 8 groups are concatenated in order to form the final 32-digit hex string.

When To Use IPv6 to Hex Converter

Use it when a tool, database, or protocol implementation needs an IPv6 address as a flat hex string rather than colon-separated groups.

It's also useful for double-checking a manual IPv6 expansion, or for teaching how the '::' shorthand maps onto the address's real 128 bits.

Often used alongside Hex to IPv6 Converter.

Features

Advantages

  • Correctly expands any valid placement of the '::' shorthand, including at the very start, very end, or as the whole address.
  • Validates strictly, rejecting malformed addresses (too many groups, multiple '::', empty groups) with a specific error rather than guessing.
  • Instant and fully client-side.

Limitations

  • Does not support the dotted-decimal IPv4-in-IPv6 notation (e.g. '::ffff:192.0.2.1'); every group must be written as hex digits.
  • Doesn't validate whether the address is a real, routable, or reserved address, only that it's syntactically well-formed.

Examples

Expanding the loopback address

Input

::1

Output

00000000000000000000000000000001

"::1" expands to 7 zero groups followed by "0001"; concatenating all 8 groups gives 32 hex digits ending in a single 1.

Expanding a documentation address with a mid-address compression

Input

2001:db8::1

Output

20010DB8000000000000000000000001

3 explicit groups (2001, db8, 1) leave 5 missing groups filled with zeros between "db8" and "1".

Best Practices & Notes

Best Practices

  • Use the Hex to IPv6 Converter to check the round trip when verifying a value you expanded here.
  • Double-check addresses with an embedded IPv4 suffix before pasting them in, since that notation isn't supported by this parser.

Developer Notes

The expansion logic explicitly counts explicit groups before and after a single '::' occurrence and fills the gap with exactly (8 - explicitCount) zero groups, matching RFC 4291's definition of the shorthand; malformed input (multiple '::', wrong group count, non-hex groups) is rejected with a specific error rather than best-effort guessing.

IPv6 to Hex Converter Use Cases

  • Converting an IPv6 address into a flat hex value for storage in a fixed-width database column
  • Feeding an IPv6 address into tooling that expects raw hex rather than colon-separated notation
  • Checking a manual IPv6 '::' expansion for correctness

Common Mistakes

  • Assuming every group needs to be typed out to 4 digits before pasting in; this tool accepts 1-4 digit groups and pads them itself.
  • Trying to use more than one '::' in a single address, which is invalid, since the parser wouldn't know how many zero groups belong in each gap.

Tips

  • The output is exactly 32 characters for any valid address, a quick way to sanity-check that expansion completed correctly.
  • Pair this with the Hex to IPv6 Converter to see the RFC 5952 canonical compressed form of any 32-digit value.

References

Frequently Asked Questions