Skip to content
OddsockLocal
Local
Source text

Formatting

1 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Enter the first address, a separator, and the last address.
  2. Use a hyphen, a comma or a space. Keep both addresses IPv4 or both IPv6.
  3. Read the blocks from the start of the range toward the end.
  4. If you needed one aligned network instead, look up that prefix in the subnet calculator.

What is IP range to CIDR?

A range of addresses is rarely a single prefix. 10.0.0.1 through 10.0.0.6 cannot be one CIDR block, because a block has to start on its own alignment. The fewest blocks that cover exactly that range are 10.0.0.1/32, 10.0.0.2/31, 10.0.0.4/31 and 10.0.0.6/32. A /29 would be 10.0.0.0 through 10.0.0.7, which includes 10.0.0.0 and 10.0.0.7, addresses you did not ask for.

Read more

Paste the start and end separated by a hyphen, a comma or whitespace. Both ends have to be the same family. IPv6 ranges work the same way, and the entire IPv6 space from :: to the last address is the single block ::/0. If the start is after the end, the page errors instead of swapping them quietly.

The list is exact cover, not a suggestion to round out to a convenient supernet. If you wanted to split one network into equal pieces, that is the subnet splitter.

Use cases

  • A firewall form wants CIDR and the ticket only has a first and last host.
  • You almost typed 10.0.0.0/29 and needed to see that it covers two addresses outside the range.
  • An IPv6 allocation is described as a start and end, and you need the shortest exact prefix list.
  • A reversed range should fail so a swapped copy-paste is not published as a rule.

Six addresses that are not one block

10.0.0.1 - 10.0.0.6

10.0.0.1/32\n10.0.0.2/31\n10.0.0.4/31\n10.0.0.6/32

Why use Oddsock

Exact cover is the point. Rounding to a larger prefix would authorize addresses the range did not include.

Related tools

Using this tool

A /29 is eight addresses aligned on a multiple of eight, so it would be 10.0.0.0 through 10.0.0.7. The range you typed excludes the first and the last of those.