IP Range Calculator
How wide is a span — the count between two addresses and the smallest aligned block that contains it, spare addresses and all.
IP Range Calculator
Results recalculate instantly on every keystroke. Nothing you type is transmitted.
What this result does not account for
- IPv4 only — the IPv6 page spans its own space
- One span at a time — no multi-range merges
In short: The span 192.168.1.32 to 192.168.1.190 holds 159 addresses. The smallest single CIDR block that contains it is 192.168.1.0/24 — 256 addresses, 97 of them spare, because alignment is the tax: blocks begin where their prefix says they begin, not where your range happens to start. One read, and the round-up is priced.
Formula
count = end − start + 1 · covering prefix = 32 − ceil(log2(start XOR end + 1))
A range is honest about being arbitrary: it can start anywhere and end anywhere, which is exactly why blocks cannot always fit it snugly. The XOR of the endpoints tells you where they first disagree in bits — every bit above that disagreement is shared, and the covering block must own down to it. When the span is itself aligned (a power-of-two block starting on its edge), the fit is perfect and the page says so; otherwise the spares are counted, not hidden.
Worked Example
- Type the low address of the span.
- Type the high address.
- Read the width and the smallest covering block.
Defaults: 192.168.1.32 – 192.168.1.190 → 159 addresses in a /24 cover. Drive the endpoints to 192.168.1.64 – 192.168.1.127 and the fit turns perfect: that span IS a /26.
Strengths & Limits Of This Model
Where this engine is strong
- Alignment tax counted in spare addresses
- Perfect-fit spans recognized, not rounded past
Where it stops
- No per-address listing — a span this size would not fit anyway
Practical Use Cases
DHCP scopes
price the pool a scope needs
ACL sizing
one block rule vs a range list
Allocation audits
how much a request really costs
Methodology & Editorial Standards
Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.
This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.
Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.
IP Range Calculator — 8 Expert FAQs
8 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.
How many addresses are in a range?
End minus start, plus one — both ends count. 192.168.1.32 through 192.168.1.190 is 159 addresses. The plus-one is the whole trick: spans are inclusive, blocks are exponential, and this page keeps the two honest.
What is the smallest block that contains a range?
Find the highest bit where the endpoints disagree (the XOR), and the covering prefix is 32 minus that many bits. The block must start on its own edge, so it usually reaches below the range's start and past its end — those spares are the alignment tax, printed here rather than ignored.
When does a range fit a block exactly?
When the count is a power of two AND the start sits on the block edge — 192.168.1.64 to 192.168.1.127 is exactly 192.168.1.64/26. Both conditions, always: 159 addresses is not a power of two, and 64 addresses starting at .65 would still straddle two /26s.
Why not just use a range in the firewall?
You can — but blocks compress. One /24 rule matches everything a 159-line range list matches, and routers evaluate prefix matches faster. The covering block tells you what the compressed rule would also match — the 97 spares — so you can decide with open eyes.
What if the two endpoints are the same address?
The span is one address and the covering block is a /32 — a host route, the perfect fit by definition. The page reads it without complaint; a point is the smallest span there is.
What if I type the endpoints backwards?
The page refuses — ranges run low to high. It would be easy to silently swap them, but a swapped range in a firewall rule is the kind of quiet mistake this page exists to catch, so it asks for the swap instead.
Does the range include network and broadcast?
The arithmetic counts every address between the endpoints, reserved pairs included — it is a span read, not a host plan. If you are sizing a DHCP pool, check the scope's own exclusions afterwards; this page prices the address space, not the policy on top of it.
How does this differ from the CIDR page?
The CIDR page carves top-down: a parent, a child size, a count. This page reads bottom-up: two arbitrary endpoints, a width, the block that swallows them. One plans, the other measures — and together they close the loop on allocation.