Technical utilities · Calculation notebook

IPv4 Subnet Calculator: Mask & Address Range: Worked Examples

Learn the inputs, formula and worked example behind the Subnet Calculator, including subnet calculator: calculation relationships, result interpretation, assumptions and sources.

Open calculator By Toolify · Updated

Purpose and steps

Subnet Calculator validates ipv4 address, prefix length before applying the displayed equation. Only IPv4 is supported. /31 has no conventional broadcast address on a point-to-point link.

  1. Determine the IPv4 network, mask, last address and address count from a prefix. For /31 the host count follows the point-to-point convention; /32 represents one address.
  2. Enter IPv4 address, Prefix length in the stated format. Baseline values are for reproduction.
  3. Check the output unit and convention: Read network with its stated unit and convention. The default example and the independent worked scenario use different inputs, so compare the assumptions before comparing the numbers.
  4. Change one input and compare the result. Only IPv4 is supported. /31 has no conventional broadcast address on a point-to-point link. VLSM planning, IPv6, network discovery and device configuration are not included.

Input reference and units

These values reproduce the model’s demonstration. Replace them with your own records or measurements; they are not recommended targets.

On a small screen, swipe the table horizontally to see all columns.

Parameters used by this calculator
ParameterDemonstration valueHow to enter it
IPv4 address192.168.1.10 Enter ipv4 address without adding a unit suffix. Scope: Only IPv4 is supported. /31 has no conventional broadcast address on a point-to-point link.
Prefix length24 Enter prefix length without adding a unit suffix. Scope: Only IPv4 is supported. /31 has no conventional broadcast address on a point-to-point link.

Model-specific method

How this calculator produces its result

Subnet Calculator: size = 2^(32−prefix); network = floor(address/size) × size. Input definitions: address = IPv4 address; prefix = Prefix length. Use the selected convention throughout the calculation.

Subnet Calculator: calculation relationships

Determine the IPv4 network, mask, last address and address count from a prefix. For /31 the host count follows the point-to-point convention; /32 represents one address. Only IPv4 is supported. /31 has no conventional broadcast address on a point-to-point link. VLSM planning, IPv6, network discovery and device configuration are not included.

The prefix fixes network bits and leaves 32−prefix host bits. A /30 has 2²=4 addresses; 192.0.2.6 belongs to the block 192.0.2.4–192.0.2.7 with mask 255.255.255.252. Under the traditional broadcast convention, two addresses are usable hosts. /31 point-to-point links and /32 addresses use the separately stated exceptions.

size = 2^(32−prefix); network = floor(address/size) × size
  • address: IPv4 address. Enter ipv4 address without adding a unit suffix. Scope: Only IPv4 is supported. /31 has no conventional broadcast address on a point-to-point link.
  • prefix: Prefix length. Enter prefix length without adding a unit suffix. Scope: Only IPv4 is supported. /31 has no conventional broadcast address on a point-to-point link.
  • Result units: stated beside each output
  • Calculation relationship: size = 2^(32−prefix); network = floor(address/size) × size
  • Supported domain: see the limits below

Worked example

Subnet Calculator baseline input: IPv4 address: 192.168.1.10; Prefix length: 24. Output: Network = 192.168.1.0; Subnet mask = 255.255.255.0; Last address = 192.168.1.255; Address count = 256; Usable hosts (RFC 3021 for /31) = 254. Substitute these values into the displayed equation to reproduce the result.

Reproduce the default scenario

This reproduces the default inputs in the reference table above; it is not an additional independent example. Displayed rounding may differ from intermediate precision.

Network
192.168.1.0
Subnet mask
255.255.255.0
Last address
192.168.1.255
Address count
256
Usable hosts (RFC 3021 for /31)
254

Reading results without overstating them

  • Read network with its stated unit and convention. The default example and the independent worked scenario use different inputs, so compare the assumptions before comparing the numbers.
  • Change one input at a time and use the equation to explain the result; do not mix unit, grade-scale, time-zone or rounding conventions across comparisons.

Assumptions and exclusions

  • Only IPv4 is supported. /31 has no conventional broadcast address on a point-to-point link.
  • VLSM planning, IPv6, network discovery and device configuration are not included.
Test a changed assumption in the calculator

Sources and content notes

Toolify describes the implemented algorithm and its assumptions. Sources below support the topic or applicable rules; they do not endorse this calculator. Examples are illustrative, and published rules take precedence over simplified estimates.

Report a formula, example or translation issue through our contact page. Include the tool name, inputs and expected result so it can be reproduced. Contact Toolify

From question to result

Continue with a related question

Explore all Technical utilities tools and guides