Preserving exact IPv6 block counts in a worksheet
An IPv6 block count can run to dozens of digits, far beyond what a spreadsheet cell or a floating-point variable stores digit for digit. This guide shows how to compare neighboring prefix counts and keep every digit.
Why a /64 already strains ordinary numbers
A /64 block holds 2^64 address values, which is 18,446,744,073,709,551,616. That is a 20-digit number. A /65 holds half as many, 9,223,372,036,854,775,808, because the extra prefix bit fixes one of the 64 remaining bits. The IPv6 subnet calculator returns each count as a string of digits so that nothing is rounded. The trouble starts when that string is pasted into a tool that converts it to a floating-point value, which keeps roughly 15 to 17 significant digits. The leading digits survive, and the trailing ones turn into zeros or noise. A count that was exact in the calculator is then only approximate in the sheet. The damage is easy to miss because the leading digits look right and the displayed number still has the correct order of magnitude. A reconciliation that compares two pasted counts may even report them as equal when their true values differ in the last few digits. Ask whether a figure came through a numeric cell before relying on its trailing digits, and compare the original text when exactness matters.
Where floating-point storage loses digits
Most spreadsheets and many programming languages store numbers as 64-bit floating-point values, which represent every whole number only up to 2^53, or 9,007,199,254,740,992. Beyond that, neighboring whole numbers share one stored value. In JavaScript, typing 18446744073709551616 prints 18446744073709552000. Spreadsheets display at most 15 significant digits, so the same count appears as 1.84467440737096E+19. A pure power of two such as 2^64 happens to be stored without error in binary, but its decimal text is cut off, and adding one to it changes nothing. A count like 2^64 + 1 cannot be represented at all in that format.
The factor of two between neighbors
Every extra prefix bit halves the block. The calculator confirms it for 2001:db8:: with prefix 64, which gives 18446744073709551616, and with prefix 65, which gives 9223372036854775808. Doubling 9,223,372,036,854,775,808 returns the first figure, digit for digit. Checking the relation is a good test of a worksheet: if the cell holding the /65 count, multiplied by two, no longer matches the /64 count in its last digits, then the sheet has rounded something. A comparison done on the text of the counts, or on integers in a tool with arbitrary precision, passes. The factor of two also means a /64 contains exactly two /65 blocks.
Larger blocks, larger numbers
The numbers grow quickly as the prefix shortens. A /56 holds 2^72, which is 4,722,366,482,869,645,213,696 addresses. A /48 holds 2^80, or 1,208,925,819,614,629,174,706,176, and a /32 holds 2^96, which is 79,228,162,514,264,337,593,543,950,336. These sizes are why IPv6 planning is usually done in units of /64 blocks, not individual addresses. A /48 contains 2^16 = 65,536 blocks of /64, and a /56 contains 2^8 = 256 of them. The calculator reports the address count for any prefix you give it, so you can check these values and then divide by the child size in whole numbers.
Keeping the digits in a worksheet
To keep a count exact, store it as text or in a tool that works with big integers. In a spreadsheet, set the cell format to text before pasting, and avoid arithmetic on the cell. When you must compare two counts, compare the digit strings, or compute the ratio as a power of two from the prefix lengths: the ratio of a /64 count to a /65 count is 2^(65-64) = 2. Writing the exponent form next to the long number, as in 2^64, gives a reader an exact reference that cannot be mangled by display rounding. The calculator output is plain digits with no thousands separators, which pastes into a text cell without changes.
Small counts for the longest prefixes
At the other end of the range, the counts are tiny. A /127 holds two addresses, and a /128 holds one, which is a single host address. The relation still halves with each added bit: 2^1 = 2 at /127 and 2^0 = 1 at /128. The formula behind the calculator is size = 2^(128 - prefix), and it covers both ends. Checking one short count and one long count against the formula is a quick way to confirm that you read the prefix correctly, because a slip between /64 and /46 changes the answer by a factor of 2^18, which is 262,144.
What an address count means
The figure is the number of address values in the block. It is not a count of installed devices, of assignments a network operator has made or of addresses a device may use. In ordinary IPv6 practice, a subnet used with stateless address autoconfiguration is a /64, because the interface identifier part of a unicast address is defined as 64 bits long in RFC 4291. The huge count inside a /64 is therefore a property of the addressing design, not a prediction that a network will ever fill it. Large counts say how much room a prefix has, nothing about how it is used. For the same reason, comparing a /64 count with the 4,294,967,296 addresses of the entire IPv4 space shows scale only: 2^64 divided by 2^32 is 2^32, so one /64 holds as many addresses as 4,294,967,296 copies of the IPv4 address space.
Documentation prefix and scope of the example
The prefix 2001:db8::/32 is reserved for documentation by RFC 3849, which is why it appears in every example here and points to no real network. The worksheet performs address arithmetic only. It reads no device, allocates nothing and does not recommend a block size, since allocation policy comes from the network owner or registry. For an exact reconciliation, keep the calculator output and the formula together: size = 2^(128 - prefix), with the prefix length stated. Anyone who later doubts a figure can recompute it from those two pieces without trusting a rounded cell.
Counting subnets inside a larger prefix
Because the counts are powers of two, the number of child blocks inside a parent is also a power of two: 2 raised to the difference of the prefix lengths. A /56 holds 2^(64 - 56) = 256 blocks of /64. A /48 holds 2^16 = 65,536 of them, and a /32 holds 2^32 = 4,294,967,296. Those smaller figures fit comfortably in any spreadsheet, so the child count can be computed without trouble even when the address counts cannot. The step to avoid is dividing one long address count by another with ordinary numbers. Computing the exponent from the prefix lengths gives the same ratio with no rounding, and it is also easier to audit.
Reproduce the checks
Sixty-four-bit remainder
Open the Ipv6 Subnet Calculator and enter:
- IP address
2001:db8::- Prefix length
64
Expected output:
Address count
18446744073709551616The expected value is compared as exact text.
Sixty-three-bit remainder
Open the Ipv6 Subnet Calculator and enter:
- IP address
2001:db8::- Prefix length
65
Expected output:
Address count
9223372036854775808The child count is exactly half the parent count.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- Primary definition and convention reference ↗ · 2026-10-08