Calculate the last IPv6 /128 with exact integer math
Index the final IPv6 address under ::/0 and check how the planner represents values beyond JavaScript’s safe Number range.
Try these inputsWorked calculation
- A /0 contains 2¹²⁸ possible /128 leaves. The final index is 2¹²⁸ − 1.
- A /128 advances one address per index. With parent start 0, the final index directly equals the address integer.
- All 128 bits of that address are set. The formatted result is ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128.
Results
- Selected child
- ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128
- Selected leaf
- ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128
- Child prefixes
- 340,282,366,920,938,463,463,374,607,431,768,211,456
IPv6 prefix tree
- Selected prefix
- Nearby or parent prefix
- Parent network
- ::/0
- Last address in parent
- ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
- Full address
- 0000:0000:0000:0000:0000:0000:0000:0000
- Compressed address
- ::
- Addresses in parent
- 340,282,366,920,938,463,463,374,607,431,768,211,456
- Leaves in selected child
- 1
- Address space
- IPv6
| Level | Index | Prefix | Selection |
|---|---|---|---|
| Child | 340282366920938463463374607431768211453 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffd/128 | Neighbor |
| Child | 340282366920938463463374607431768211454 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe/128 | Neighbor |
| Child | 340282366920938463463374607431768211455 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128 | Selected |
| Leaf | 0 | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128 | Selected |
Questions
Will converting the last IPv6 index to a JavaScript Number preserve it?
No. Keep it as BigInt or a decimal string to retain the exact value.
How long is the decimal string for the last IPv6 address?
The unsigned maximum has 39 decimal digits.