Technical utilities · Calculation notebook

IPv4 & IPv6 CIDR Calculator: Prefix & Address Count: Worked Examples

Translate CIDR prefixes into IPv4 or IPv6 ranges and exact address counts. Follow two prefix examples, separating block size from usable-host policy.

Why the calculation is structured this way

CIDR masks the leading prefix bits and clears the remainder to form a network boundary. Total size is a power of two based on address width. Multiple smaller prefixes fit inside a larger one according to 2^(new prefix − old prefix), assuming alignment and the same address family.

A second scenario you can verify

A documentation IPv4 /24 contains sixteen /28 blocks because 2^(28 − 24) = 16, each with sixteen raw addresses. An IPv6 /56 contains 256 /64 blocks because 2^8 = 256. These two examples count blocks rather than subtracting operational reservations from the block count.

What changes the interpretation

A host address with a prefix is normalized to its containing block, which may hide typed host bits if the original is not retained. IPv6 zero compression is notation only. Historical, reserved and documentation-use semantics require separate standards and deployment review.

Compare child prefixes and distinguish containment from allocation

CIDR is a compact range description. A host address with a prefix identifies the containing block after host bits are cleared. It does not require that the typed endpoint already be the network boundary, but the normalized result should be labeled so the original endpoint is not mistaken for the block’s start.

An IPv4 /26 inside a /24 has sixty-four raw addresses, and four aligned /26 blocks cover the parent. For documentation parent 192.0.2.0/24, their starts are .0, .64, .128 and .192. Entering .100/26 normalizes to .64/26. A proposed start .100 is not an aligned /26 network simply because a range of sixty-four consecutive integers could be drawn from it.

An IPv6 /60 contains sixteen /64 blocks because four extra prefix bits are selected. A /56 contains 256 /64 blocks. These counts describe possible binary subdivisions, not the number of sites that should receive them. Network addressing practice can impose a standard allocation size even when pure range arithmetic permits another one.

For a containment check, compare whether a candidate address shares all parent-prefix bits. A text prefix comparison on compressed IPv6 strings is unreliable: different valid representations can encode the same address. Normalize numerically, preserve exact width and record the source convention. Raw address totals for IPv6 and special IPv4 prefixes should not be marketed as a universal usable-device count.

Reserved, private, documentation and public allocation semantics require standards and operational records beyond this arithmetic tool. A returned block is not a routing announcement, permission to configure a host or confirmation that the range belongs to the person entering it. Use the results to understand boundaries, then review the actual deployment context separately.

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 horizontally to see all columns. With a keyboard, focus the table and use the arrow keys.

Parameters used by this calculator
ParameterDemonstration valueHow to enter it
IPv4/prefix or IPv6/prefix192.168.1.10/24 Enter ipv4/prefix or ipv6/prefix without adding a unit suffix. Scope: IPv4 uses /0–/32, with /31 point-to-point and /32 single-address host-count conventions. IPv6 uses /0–/128 and has no broadcast-address subtraction.

CIDR Calculator: calculation relationships

Calculate IPv4 or IPv6 network boundaries, mask, last address and exact address count. Compressed IPv6 and embedded IPv4 tails are accepted; IPv6 counts remain exact decimal strings. IPv4 uses /0–/32, with /31 point-to-point and /32 single-address host-count conventions. IPv6 uses /0–/128 and has no broadcast-address subtraction. A count does not establish device routability or subnet allocation policy. VLSM planning, zone identifiers, discovery and configuration are outside this tool.

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. IPv6 has 128 address bits: 2001:db8::/64 contains 2⁶⁴ = 18,446,744,073,709,551,616 addresses. It has no IPv4-style broadcast-address subtraction, and its exact count is kept as a decimal string.

size = 2^(address bits−prefix); network = floor(address/size) × size; address bits = 32 or 128
  • cidr: IPv4/prefix or IPv6/prefix. Enter ipv4/prefix or ipv6/prefix without adding a unit suffix. Scope: IPv4 uses /0–/32, with /31 point-to-point and /32 single-address host-count conventions. IPv6 uses /0–/128 and has no broadcast-address subtraction.
  • Result units: stated beside each output
  • Calculation relationship: size = 2^(address bits−prefix); network = floor(address/size) × size; address bits = 32 or 128
  • Supported domain: see the limits below

Worked example

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

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

Common questions and boundary checks

Does a higher prefix mean more addresses?

No. It leaves fewer host bits and creates a smaller block.

How many /28 blocks fit in /24?

Sixteen aligned blocks.

How many /64 blocks fit in /56?

Two hundred fifty-six.

Does :: compression reduce IPv6 bit width?

No. It abbreviates zero groups within the 128-bit address.

Are raw counts equal to deployable-device counts?

Not necessarily. Address roles and network policies are separate.

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