Skip to content
Hex Calculator

Hex to IPv6 Converter

Convert a 32-digit hex value into a standard, compressed IPv6 address — with automatic "::" zero-run compression.

IPv6 address
2001:db8::ff00:42:8329
Swapnil Sanghvi

Built by

Swapnil Sanghvi

Full-Stack Web Developer & WordPress Developer

Swapnil Sanghvi is a full-stack web and WordPress developer, UI designer, and full-time freelancer who builds and maintains Hex Calculator.

Hex to IPv6 Converter tool preview card from Hex Calculator
Share preview: this is the card that appears when you share the Hex to IPv6 Converter page on social media.

Further reading: IPv4 — Wikipedia

How to Convert Hex to IPv6

Pad the value to 32 hex digits, split it into 8 groups of 4 digits each, then strip unnecessary leading zeros from each group. Finally, find the longest run of all-zero groups (2 or more) and compress it to "::" — the standard, shortest way to write an IPv6 address.

Hex to IPv6 Example, Step by Step

0x20010db8000000000000ff0000428329 = 2001:db8::ff00:42:8329

hex -> 2001:db8::ff00:42:8329

2001 0db8 0000 0000 0000 ff00 0042 8329

Strip leading zeros per group, compress the longest zero run:

2001:db8::ff00:42:8329
StepDescriptionResult
Split into 8 groups of 4 digits2001, 0db8, 0000, 0000, 0000, ff00, 0042, 83298 groups
Strip leading zeros per group0db8 -> db8, 0042 -> 42shortened groups
Compress the longest zero run3 consecutive zero groups become ::2001:db8::ff00:42:8329

This is a real, well-known IPv6 documentation example address (2001:db8::/32 is reserved specifically for documentation and examples).

Where Hex to IPv6 Actually Comes Up

Reading a Raw IPv6 Address From Packet Data

Packet captures and low-level networking APIs sometimes expose an IPv6 address as a contiguous 32-digit hex string — converting it to standard notation makes it readable.

raw hex bytes -> standard IPv6 text form

Decoding an IPv6 Value From a Database or Log

Some systems store IPv6 addresses as a plain hex-encoded 128-bit value for compact storage — converting back to standard notation is needed to read or search for it meaningfully.

database hex column -> readable address

Verifying an IPv6 Compression Implementation

When writing code that formats IPv6 addresses, checking that it compresses the longest (and, in a tie, the first) zero run correctly, per RFC 5952, is a common correctness check.

confirm :: goes in the right place

Why Use This Calculator Instead of Doing It by Hand

  • Applies the RFC 5952 zero-compression rule automatically
  • Handles leading-zero stripping per group without manual counting
  • Runs entirely in your browser — nothing you type gets sent anywhere
  • Pads shorter hex input to the full 128 bits automatically

Limitations

  • Doesn't render an embedded IPv4 address in dotted-decimal form (like ::ffff:192.0.2.1) — the output is always pure hex-group notation.
  • Input longer than 32 hex digits is rejected, since that exceeds the 128-bit IPv6 address space.

Frequently Asked Questions

How many hex digits does an IPv6 address need?

32 — an IPv6 address is 128 bits, and each hex digit represents 4 bits, so 128 / 4 = 32 digits. This converter pads a shorter value with leading zeros to reach the full 32 digits.

What does "::" mean in the output?

It's shorthand for one or more consecutive all-zero groups — standard IPv6 notation compresses the longest run of zero groups to "::" to shorten the address, and this converter applies that compression automatically.

Why does the output use lowercase letters?

RFC 5952 (the IPv6 text representation standard) recommends lowercase hex letters for canonical IPv6 address text — this converter follows that recommendation.

What if there are two separate runs of zero groups?

Only the longest run gets compressed to "::" (and if there's a tie, the first one) — a second, shorter run of zeros is written out in full, since "::" can only appear once in a valid IPv6 address.