Description
Subtract prefixLength from 128 and calculate 2 raised to that host-bit count using exact integers.
A network prefix divides an address into higher prefix bits and lower address bits. Zone labels and textual address tokens introduce separate representation rules.
Subtract prefixLength from 128 and calculate 2 raised to that host-bit count using exact integers.
When to use this tool
Use IPv6 Prefix Host Bit Count when you need a prefix-field calculation or a controlled address-token split.
How to use the tool and how it works
- Enter prefixLength. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read hostBits, addressCountDecimal. Use the output convention below.
Subtract prefixLength from 128 and calculate 2 raised to that host-bit count using exact integers. Return the count as decimal text.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| prefixLength | Prefix Length | Required. Safe integer; minimum 0; maximum 128. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| hostBits | Host Bits | Required. Safe integer. |
| addressCountDecimal | Address Count Decimal | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"prefixLength": 64
},
"output": {
"hostBits": 64,
"addressCountDecimal": "18446744073709551616"
}
} Limitations and assumptions
- Address count is a mathematical prefix size, not a count of reachable or assignable hosts.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use a full address parser and the relevant allocation or interface metadata to validate actual addressing.
References
Similar or alternative tools
- IPv6 Prefix Subnet ID Field
Extract the bits between globalPrefixLength and subnetPrefixLength with exact integer shifts and masking, returning subnetId as decimal text and the field width.
- IPv6 Zone Token Splitter
Split the unbracketed literal at its sole percent sign.