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.
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.
Check the stated input format, calculation convention and limits before using the result.
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.
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.
CIDR Calculator: size = 2^(32−prefix); network = floor(address/size) × size. Input definitions: cidr = IPv4/prefix. Use the selected convention throughout the calculation.
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.
Content and calculation reviewed:
Understand the calculation
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