IPv6 to Hex Converter
Convert a standard IPv6 address (including "::" compressed form) into its full 32-digit hexadecimal representation.

Built by
Swapnil SanghviFull-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.
Further reading: IPv4 — Wikipedia
How to Convert IPv6 to Hex
If the address uses "::" shorthand, expand it to the correct number of all-zero groups first, so you have 8 groups total. Then pad each group to 4 hex digits (with leading zeros) and join all 8 groups together into one 32-digit hex value.
IPv6 to Hex Example, Step by Step
2001:db8::ff00:42:8329 = 0x20010DB8000000000000FF0000428329
2001:db8::ff00:42:8329 -> hex
2001:db8::ff00:42:8329 Expand :: to fill 8 groups: 2001 0db8 0000 0000 0000 ff00 0042 8329 Pad each group to 4 digits, join: 20010db8000000000000ff0000428329
| Step | Description | Result |
|---|---|---|
| Count existing groups | 5 groups given, :: fills the remaining 3 | 3 zero groups inserted |
| Pad each group to 4 digits | db8 -> 0db8, 42 -> 0042 | 8 groups of 4 digits |
| Concatenate all 8 groups | in order, no separators | 0x20010DB8000000000000FF0000428329 |
2001:db8::/32 is the address block reserved specifically for documentation examples, which is why it shows up so often in networking references.
Where IPv6 to Hex Actually Comes Up
Storing an IPv6 Address as a Fixed-Width Value
Some databases and low-level data structures store IPv6 addresses as a plain 128-bit hex value rather than text, for fixed-width storage and faster comparison.
IPv6 column stored as a 32-digit hex value
Constructing Test Data for a Parser
Generating the exact hex representation of a known IPv6 address gives you a predictable input for testing code that parses or compares IPv6 addresses at the byte level.
known address -> exact hex bytes
Comparing Two Addresses at the Bit Level
Converting both addresses to their full hex form makes it straightforward to compare them byte by byte, or to compute a bitwise operation like a subnet mask application.
address & subnet mask, both in hex
Why Use This Calculator Instead of Doing It by Hand
- Handles "::" expansion automatically, avoiding a manual zero-counting mistake
- Validates each group is a proper 1-4-digit hex value
- Runs entirely in your browser — nothing you type gets sent anywhere
- Catches malformed addresses (wrong group count, multiple ::) with a clear error
Limitations
- Doesn't accept an embedded IPv4 tail (like ::ffff:192.0.2.1) — enter the address in pure hex-group notation.
- Rejects more than one "::" in the input, per the IPv6 addressing standard.
Frequently Asked Questions
Does this accept compressed "::" notation?
Yes — "::" is expanded back to the correct number of zero groups to make a full 8-group address before converting, so you can paste an address exactly as it's normally written.
How do you convert IPv6 to hex?
Expand any "::" shorthand to the full 8 groups, pad each group to 4 hex digits with leading zeros, then concatenate all 8 groups into one 32-digit hex value.
What if I enter an address with fewer than 8 groups and no "::"?
It's rejected — a full, uncompressed IPv6 address needs exactly 8 groups; anything else without "::" to fill the gap is an incomplete address.
Can "::" appear more than once?
No — a valid IPv6 address uses "::" at most once, since using it twice would make the number of zero groups it represents ambiguous. This converter rejects an address with more than one "::".