IP Range To CIDR Calculator
Work out ip range to cidr instantly with clear inputs, formula shown and shareable results.
About IP Range To CIDR Calculator
An arbitrary address range rarely maps to one CIDR prefix, because every prefix must start on a boundary that is a multiple of its own size. The greedy algorithm takes the largest aligned block that fits at the current address, emits it, and repeats until the end of the range is reached — which is exactly how firewall and ACL generators expand a range.
Formula
Greedy CIDR decomposition
at each address take the largest 2^k block where address mod 2^k = 0 and address + 2^k - 1 <= end; repeat
Worked example
With the default values below, IP Range To CIDR Calculator returns CIDR blocks covering the range of 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/28, 192.168.1.32/27, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/29, 192.168.1.200/32. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Start of range
- 192.168.1.10
- End of range
- 192.168.1.200
Results
- CIDR blocks covering the range
- 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/28, 192.168.1.32/27, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/29, 192.168.1.200/32
- Number of blocks required
- 8
- Addresses in range
- 191
- Largest single block
- /26
Step by step
- 1Values used
- 2Greedy CIDR decomposition
- 3CIDR blocks covering the range= 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/28, 192.168.1.32/27, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/29, 192.168.1.200/32
- 4Number of blocks required= 8
- 5Addresses in range= 191
- 6Largest single block= /26
Assumptions and limits
- The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why does a small range need several prefixes?
Alignment. 192.168.1.10 is not a multiple of 8, so the first block can only be a /31 or /32 until the pointer reaches an aligned boundary.
How do I get a single prefix?
Choose a start address that is a multiple of the block size and an end address one below the next boundary — for example 192.168.1.0 to 192.168.1.255 is exactly one /24.
Related Calculators
- IP To Hexadecimal Calculator
- Reserved IP Range Checker Calculator
- First And Last Usable IP Calculator
- IP Address Class Calculator
- IP Address Plan For Sites Calculator
- IPv4 To IPv6 Mapping Calculator
- Multicast Address Range Calculator
- Point To Point Link Addressing Calculator
- Private vs Public IP Calculator
- ARP Table Size Calculator
You might also need
- Multicast Address Range CalculatorAlso in IP Addressing & Subnetting
- Reserved IP Range Checker CalculatorAlso in IP Addressing & Subnetting
- IP To Hexadecimal CalculatorAlso in IP Addressing & Subnetting
- IP Address Class CalculatorAlso in IP Addressing & Subnetting
- IPv6 EUI 64 CalculatorAlso in IP Addressing & Subnetting
- Loopback Addressing Plan CalculatorAlso in IP Addressing & Subnetting
