Subnet Calculator Free

IP Range to CIDR

An IP range calculator shows that 192.168.1.10 to 192.168.1.20 holds 11 addresses and needs 4 CIDR blocks: 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/30 and 192.168.1.20/32. It always finds the fewest blocks that cover exactly your range, in address order. Enter your own start and end below.

IP range to CIDR converter

CIDR blocks for the range
CIDR blockFirst addressLast addressAddressesActions
192.168.1.10/31192.168.1.10192.168.1.112 Details
192.168.1.12/30192.168.1.12192.168.1.154 Details
192.168.1.16/30192.168.1.16192.168.1.194 Details
192.168.1.20/32192.168.1.20192.168.1.201 Details

4 blocks, 11 addresses

Each block starts on a boundary that matches its size. The tool takes the biggest block that fits, then repeats, so the list is as short as it can be.

Last updated

How to convert an IP range to CIDR

  1. Enter the first address of the range in the Start address box.
  2. Enter the last address of the range in the End address box.
  3. Read the list of CIDR blocks: it is the fewest blocks that cover exactly your range.
  4. Copy the list, or open a block in the CIDR calculator for its full details.

Why a range needs more than one block

A CIDR block of 2^n addresses has to start at an address that is a multiple of 2^n. A /30 starts on a multiple of 4, a /28 on a multiple of 16 and a /24 on a multiple of 256. A range that does not start and end on those boundaries cannot be one block.

192.168.0.100 to 192.168.1.50 covers 207 addresses. The address 100 is not a multiple of 8, so the first block is a /30. The blocks then grow until the address reaches 192.168.1.0 and shrink again toward the end, which gives 8 blocks:

192.168.0.100 to 192.168.1.50 as CIDR blocks
CIDR blockFirst addressLast addressAddresses
192.168.0.100/30192.168.0.100192.168.0.1034
192.168.0.104/29192.168.0.104192.168.0.1118
192.168.0.112/28192.168.0.112192.168.0.12716
192.168.0.128/25192.168.0.128192.168.0.255128
192.168.1.0/27192.168.1.0192.168.1.3132
192.168.1.32/28192.168.1.32192.168.1.4716
192.168.1.48/31192.168.1.48192.168.1.492
192.168.1.50/32192.168.1.50192.168.1.501

Ranges that are a single block

When a range starts on a boundary and ends exactly one block later, the answer is one line. These three are single blocks:

Ranges that are one CIDR block
First addressLast addressCIDR blockAddresses
192.168.1.0192.168.1.255192.168.1.0/24256
10.0.0.010.0.3.25510.0.0.0/221,024
172.16.0.0172.31.255.255172.16.0.0/121,048,576

To see the mask, wildcard and host range of a block, open it with the Details link in the table, or use the subnet mask cheat sheet to compare prefix lengths.

Frequently asked questions

How do I convert an IP range to CIDR?

Take the largest aligned block that starts at the first address and fits inside the range, write it as CIDR, then repeat from the next address. 192.168.1.10 to 192.168.1.20 becomes 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/30 and 192.168.1.20/32. The converter does this and shows the fewest blocks.

Why does one range need several CIDR blocks?

A CIDR block must start on a boundary that matches its size. A range that starts or ends off those boundaries has to be cut into several blocks. 192.168.0.100 to 192.168.1.50 covers 207 addresses and needs 8 blocks, from 192.168.0.100/30 to 192.168.1.50/32. An aligned range needs only one.

Is 192.168.1.0 to 192.168.1.255 a single CIDR block?

Yes. It is exactly 192.168.1.0/24, which holds 256 addresses. Other aligned examples are 10.0.0.0 to 10.0.3.255, which is 10.0.0.0/22 with 1,024 addresses, and 172.16.0.0 to 172.31.255.255, which is 172.16.0.0/12 with 1,048,576. When a range is aligned, the answer is one block.

What is the CIDR for a single IP address?

A single address is a /32 block. The range 10.0.0.1 to 10.0.0.1 is 10.0.0.1/32 with 1 address. In IPv6 a single address is a /128. Use this when a firewall or routing list asks for CIDR notation and you only have one address.

Does the converter give the fewest blocks?

Yes. It returns the fewest CIDR blocks that cover exactly the range you entered, in address order, with nothing extra and nothing missing. For 192.168.1.10 to 192.168.1.20 that is 4 blocks covering 11 addresses. A shorter list would have to include addresses outside your range.

Can I convert an IPv6 range too?

Yes. Enter two IPv6 addresses and the converter works the same way. The range 2001:db8:: to 2001:db8::ff is the single block 2001:db8::/120 with 256 addresses. You cannot mix families: an IPv4 start with an IPv6 end shows a message asking for two addresses of the same kind.