b2KIT

IP Range Calculator

Calculate IP address ranges from start/end addresses or CIDR blocks with overlap detection and merging.

Tested tool guide Tested browser tools Checked August 16, 2026

What IP Range Calculator does, with a checked example

IP Range Calculator turns either an explicit start/end pair or a CIDR block into the interval of addresses it covers. With several entries, it identifies intervals that intersect and can combine overlapping coverage into a single range, making duplicate coverage visible. The common surprise is CIDR alignment: a prefix denotes a fixed, power-of-two block, not an arbitrary number of addresses beginning at the typed value. Range endpoints are inclusive, so the first and last address both contribute to the count.

Worked example

A concrete input and expected output from the current implementation.

Input

192.0.2.0/30

Expected output

192.0.2.0 - 192.0.2.3 (4 addresses)

An IPv4 /30 fixes 30 of 32 bits, leaving two bits to vary. Their four combinations produce .0, .1, .2, and .3, so the inclusive count is 3 - 0 + 1 = 4.

How the result is produced

1

Expanding boundaries

For a start/end entry, the boundary addresses define one inclusive interval. For an IPv4 CIDR, the prefix length determines how many low-order address bits vary; clearing those bits gives the first address and setting them gives the last. A /30 leaves two varying bits, yielding 2^2, or four, addresses. CIDR ranges therefore have power-of-two sizes and aligned boundaries.

2

Detecting overlap

Two entries overlap when at least one address lies in both inclusive intervals. Merging overlapping entries keeps the lowest start and highest end. Transitive overlaps also form continuous coverage: if range A overlaps B and B overlaps C, their union has no gap. The merged result summarizes covered addresses, but it does not preserve which original entry contributed each address.

Good uses

  • Check whether firewall allowlist entries cover some of the same addresses before simplifying the list.
  • Convert a CIDR allocation into first and last addresses for a ticket, inventory record, or access review.
  • Combine repeated, nested, or partially overlapping ranges copied from deployment configuration to inspect their continuous coverage.

Limits and checks

  • CIDR notation is block-based. If an entered address has host bits set, inspect the calculated first address instead of assuming the typed address is the beginning of the block.
  • The inclusive address count is not necessarily a usable-host count. Network, broadcast, gateway, reserved-address, and local policy exclusions are separate from the mathematical range.
  • A merged interval can conceal whether the source ranges were identical, nested, or only partially overlapping. Retain the original entries when their provenance matters.

Common questions

Does 192.0.2.0/30 contain two addresses or four?

It spans four addresses: 192.0.2.0 through 192.0.2.3. Some IPv4 subnet discussions quote two traditional host addresses because they exclude the network and broadcast addresses. The calculated range is the full inclusive interval, so it has four values. Whether every value is assignable is a separate deployment question.

Can every start/end range be represented by one CIDR block?

No. A single CIDR block must contain a power-of-two number of addresses and begin on the boundary implied by its prefix. For example, 192.0.2.1 through 192.0.2.6 contains six addresses and cannot be one CIDR block. It must remain a start/end interval or be represented by multiple CIDR blocks.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools