Technical utilities

CIDR 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 CIDR Calculator

CIDR Calculator validates ipv4/prefix 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 CIDR Calculator?

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

Worked example

How can I reproduce the CIDR Calculator example?

CIDR Calculator baseline input: IPv4/prefix: 192.168.1.10/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 CIDR 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 CIDR 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/prefix 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.

CIDR Calculator: calculation relationships

CIDR combines an IPv4 address and prefix in one string. The host portion of 192.0.2.5/31 is rounded down to the aligned network 192.0.2.4; the block contains .4 and .5. RFC 3021 permits both on a point-to-point link. That convention is not a promise that any device or broadcast network accepts the configuration.

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