Monitoring
Solutions
Resources
Free Tools
Pricing
Free Tools / IP addresses / IPv6 to Decimal Converter

IPv6 to Decimal Converter

Type an IPv6 address or a whole number. Get the other form at once, with the compressed and expanded spellings, hex and binary.

Runs entirely in your browser — nothing you enter here is sent to a server.

An IPv6 address as one number

An IPv6 address is 128 bits, written as eight groups of four hexadecimal digits. Read as a single whole number it runs from 0 to 2¹²⁸ − 1 — a value with up to 39 decimal digits. 2001:db8::ff00:42:8329 is 42540766411282592856903984951653826561. The decimal form is rarely typed by hand, but it is how range comparisons work and how some geolocation and allocation datasets list IPv6 blocks.

Too big for an integer

128 bits do not fit a 64-bit number. Languages need big-integer types; JavaScript needs BigInt.

Store it as 16 bytes

In MySQL use VARBINARY(16) with INET6_ATON(). The bytes sort in address order.

Or as a native type

PostgreSQL's inet and cidr types hold IPv4 and IPv6 and support "is contained in" directly.

Two halves

Some systems split the address into two 64-bit integers: the network prefix and the interface ID.

How the conversion works

Expand the address so that all eight groups are present, drop the colons, and you have a 32-digit hexadecimal number. Converting that from base 16 to base 10 gives the decimal form. Going back, write the number in hex, pad it to 32 digits, cut it into groups of four and apply the usual shortening rules. The result does not depend on how the address was typed: 2001:0DB8:0:0:0:0:0:1 and 2001:db8::1 give the same number.

Frequently asked questions

What is the largest IPv6 address as a number?

340,282,366,920,938,463,463,374,607,431,768,211,455 — that is 2¹²⁸ − 1, the address ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff.

Can I store an IPv6 address in a BIGINT column?

No. BIGINT is 64 bits and an IPv6 address is 128. Use a 16-byte binary column, two BIGINT columns, or a native inet type.

Does the decimal form depend on how the address is written?

No. Compressed, expanded, upper or lower case — all spellings of the same address give the same number.

How do I convert the number back in SQL?

In MySQL, INET6_NTOA() turns the 16-byte value back into text. In PostgreSQL the inet type prints as an address already.

Related free tools

Your site may answer on IPv4 and be down on IPv6 without anyone noticing.

Upzilla monitors uptime and response time from several locations and alerts you by email, Slack or Telegram. 10 monitors free.

Start monitoring free →