Skip to content

Main content

Network Prefix Child Index From Address Tool

Calculate network prefix child index from address from explicit caller-supplied inputs.

Loading tool…

Description

Mask the unsigned IPv4 address to parentPrefix and divide its offset within that parent by the child subnet size.

A network prefix divides an address into higher prefix bits and lower address bits. Zone labels and textual address tokens introduce separate representation rules.

Mask the unsigned IPv4 address to parentPrefix and divide its offset within that parent by the child subnet size.

When to use this tool

Use Network Prefix Child Index From Address when you need a prefix-field calculation or a controlled address-token split.

How to use the tool and how it works

  1. Enter address, parentPrefix, childPrefix. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read childIndex, parentNetwork. Use the output convention below.

Mask the unsigned IPv4 address to parentPrefix and divide its offset within that parent by the child subnet size. Return zero-based childIndex and the integer parentNetwork.1

Input fieldMeaning and unitsAccepted input
addressAddressRequired. Safe integer; minimum 0; maximum 4294967295.
parentPrefixParent PrefixRequired. Safe integer; minimum 0; maximum 32.
childPrefixChild PrefixRequired. Safe integer; maximum 32.
Output fieldInterpretationReturned shape
childIndexChild IndexRequired. Safe integer.
parentNetworkParent NetworkRequired. Safe integer.
json
{
  "input": {
    "address": 3232235936,
    "parentPrefix": 24,
    "childPrefix": 26
  },
  "output": {
    "childIndex": 2,
    "parentNetwork": 3232235776
  }
}

Limitations and assumptions

  • Addresses are numeric 32-bit values, not dotted strings; childPrefix must be at least parentPrefix.
  • 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

  1. Calculation and input contract: network/network-prefix-child-index-from-address — tool.io

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 Prefix Host Bit Count

    Subtract prefixLength from 128 and calculate 2 raised to that host-bit count using exact integers.