Calculation notebook · use case

Inspect an IPv6 Prefix Before Planning Address Blocks

IPv6 uses 128-bit addresses. A prefix length states how many leading bits belong to the network. Arithmetic inspection helps you compare blocks, but it does not assign addresses, validate a deployment architecture or replace a routing policy.

Read the network and host bits

An IPv6 /64 fixes 64 leading bits and leaves 64 bits. Its block contains 2^64 = 18,446,744,073,709,551,616 addresses. Keep this as an exact integer rather than rounding it to a floating-point value. A larger prefix number describes a smaller block.

Inspect one documented address range

For illustrative documentation prefix 2001:db8:1234:5678::/64, the first four hexadecimal groups form the fixed 64-bit network portion. The remaining four groups run from all zeroes to all ffff. Documentation addresses are examples; they should not be treated as globally assigned production addresses.

Inspect one documented address range
QuantityValue
Address width128 bits
Prefix/64
Remaining bits64
Address count18,446,744,073,709,551,616

Count smaller prefixes inside a larger one

A /48 contains 2^(64 − 48) = 65,536 distinct /64 blocks. A /56 contains 256 /64 blocks. These counts describe binary partitioning, not the number of customers, interfaces or active devices a network should support. Operational policies determine the chosen allocation.

Do not subtract an IPv4 broadcast pair

IPv6 does not use the IPv4 directed-broadcast address convention. The mathematical address total should not be reduced by two merely because a traditional IPv4 subnet calculator does so. Address roles, reserved use and interface policy remain separate from raw range size.

Check network alignment and notation

When host bits in an entered address are nonzero, the calculator derives the containing prefix by clearing those bits. Compressed :: notation represents runs of zero groups and does not shorten the address width. Record both the original address and the normalized network when auditing an input.

Normalize a prefix that ends inside a hexadecimal group

Enter the documented example 2001:db8:abcd:1234::dead:beef/60. Sixty prefix bits preserve the first three sixteen-bit groups and the first twelve bits of the fourth. Its containing network is 2001:db8:abcd:1230::, and its last address is 2001:db8:abcd:123f:ffff:ffff:ffff:ffff. The low hexadecimal digit of the fourth group is part of the host range, not a permanently fixed network digit.

The block contains 2⁶⁸ = 295,147,905,179,352,825,856 addresses because sixty of 128 bits are fixed. That is sixteen times the raw count in a /64. Keeping the count as an exact decimal string matters: a floating-point display may conceal low-order precision loss even when the magnitude looks correct. The calculator normalizes the entered host address to its containing block rather than claiming the original host is itself the network boundary.

Count subprefixes and verify their combined sizes

The /60 contains sixteen /64 blocks, with fourth-group endings 1230 through 123f in this example. Multiplying sixteen by 2⁶⁴ reconstructs 2⁶⁸, giving an independent partition check. A /48 contains 256 /56 blocks, and each /56 contains 256 /64 blocks. Their product, 256 × 256 = 65,536, agrees with the direct /48-to-/64 difference of sixteen prefix bits.

These are counts of mathematically aligned subranges, not a recommended number of interfaces or customers. A proposed allocation must have its host bits cleared at the chosen prefix boundary to identify a network. Choosing a prefix length changes both the count and the mask; shortening the printed address with :: changes neither. Record the parent range and the desired subprefix length when reproducing a partition calculation.

Inspect /127 and /128 without copying IPv4 rules

The illustrative range 2001:db8::/127 has two raw addresses: 2001:db8:: and 2001:db8::1. A /128 fixes every bit and contains one address, which is simultaneously its first and last address. Subtracting an IPv4-style network-and-broadcast pair from these raw IPv6 counts would produce zero or a negative number, demonstrating why that family-specific rule must not be imported.

The arithmetic result does not establish that every address has the same operational role. Interface configuration, routing, reserved uses and deployment standards are separate from raw range size. The tools reject a prefix above 128 and do not interpret an interface zone identifier such as %eth0 as part of a plain address. An embedded dotted IPv4 tail is an address notation feature, not a switch to a thirty-two-bit block calculation.

Keep the address audit textual and family-aware

Use the CIDR form for a single address/prefix string or the subnet form for separate address and prefix fields. Preserve the original entry, normalized network, final address, mask and exact count in the audit record. JSON serialization should retain the decimal count as text; native BigInt is an internal arithmetic choice and is not a directly serializable JSON number. Compare exact strings or integer-capable values rather than rounded scientific notation.

Compressed notation permits one :: run and expands to eight hexadecimal groups; leading zeroes and uppercase letters can be normalized without altering the integer. An invalid group, a second compression run or an out-of-range dotted tail is rejected rather than repaired by guessing. Documentation prefixes remain examples. The calculator does not probe a network, discover devices, configure routes or confirm that a prefix is assigned to the person entering it.

Questions and checks

Does IPv6 have an IPv4-style broadcast address?

No. Do not apply the traditional minus-two rule to its address total.

How many /64 blocks fit in a /48?

Exactly 2^16, or 65,536.

Does a prefix count indicate an approved allocation?

No. It is arithmetic on a range; allocation and routing require operational context.

Sources and scope

The examples are illustrative calculations, not records of individual users. Check the policy or measurements that apply to your situation.

Try the calculations