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.
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 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.
128 bits do not fit a 64-bit number. Languages need big-integer types; JavaScript needs BigInt.
In MySQL use VARBINARY(16) with INET6_ATON(). The bytes sort in address order.
PostgreSQL's inet and cidr types hold IPv4 and IPv6 and support "is contained in" directly.
Some systems split the address into two 64-bit integers: the network prefix and the interface ID.
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.
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.
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.
No. Compressed, expanded, upper or lower case — all spellings of the same address give the same number.
In MySQL, INET6_NTOA() turns the 16-byte value back into text. In PostgreSQL the inet type prints as an address already.
Upzilla monitors uptime and response time from several locations and alerts you by email, Slack or Telegram. 10 monitors free.