Technical utilities

Subnet Calculator

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.

  • Explicit formulas and worked examples
  • Check your inputs, then calculate
  • Data is calculated in this browser only

Check the stated input format, calculation convention and limits before using the result.

Your inputs

Local calculation

Check the example inputs, then calculate. Your values stay in this browser.

Only IPv4 is supported. /31 has no conventional broadcast address on a point-to-point link.

Calculation notes

Understand the Subnet Calculator

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.

Formula and logic

What is the formula for the Subnet Calculator?

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.

Worked example

How can I reproduce the Subnet Calculator 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.

How to read the result

How should I interpret the Subnet Calculator result?

  • 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.
Limits and assumptions

What limits apply to the Subnet Calculator?

  • 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.

Content and calculation reviewed:

Understand the calculation

How to use it and the math behind it

Read the complete explanation

Four steps to check your inputs and results

  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.

Subnet Calculator: calculation relationships

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

The detailed guide adds variable definitions, a reproducible example, a practice question and model limitations.

From question to result

Continue with a related question

Explore all Technical utilities tools and guides