LightAtom

CIDR Calculator — CIDR to IP Range

Turn a CIDR block like 10.0.0.0/22 into its first and last address, mask and size, or turn a start–end IP range into the exact CIDR blocks that cover it.

Try: , ,

CIDR block
10.0.0.0/22
IP range
10.0.0.0 – 10.0.3.255
Addresses
1,024
Usable hosts
1,022
Subnet mask
255.255.252.0
Wildcard mask
0.0.3.255

How to use it

  1. To expand a block, type it in CIDR notation, such as 10.0.0.0/22.
  2. To go the other way, type a range as start - end, such as 192.168.1.5 - 192.168.1.20.
  3. Copy the range or the list of CIDR blocks from the result.

What the result means

For a CIDR block, you get the first and last address of the range, the number of addresses and usable hosts, and the subnet and wildcard masks.

For an IP range, you get the shortest list of CIDR blocks that covers exactly that range, no more and no less. A range that lines up with a power-of-two boundary collapses into one block (10.0.0.0 – 10.0.3.255 is just 10.0.0.0/22). An irregular range needs several: 192.168.1.5 – 192.168.1.20 becomes five blocks, from a /32 up to a /29. That's the format firewalls, cloud security groups and allow-lists expect.

Frequently asked questions

How do I convert CIDR to an IP range?

The prefix says how many leading bits are fixed. Set the remaining bits to 0 for the first address and to 1 for the last. 10.0.0.0/22 fixes 22 bits, so the last 10 vary: 10.0.0.0 to 10.0.3.255, 1,024 addresses.

How do I convert a subnet mask to CIDR?

Count the 1 bits in the mask. 255.255.255.0 has 24, so it's /24; 255.255.240.0 has 20, so /20. You can type an address and a mask into the calculator, such as 10.0.0.1 255.255.240.0, and it shows the CIDR form.

What is a supernet?

A block that combines smaller contiguous networks into one. Four /24s from 10.0.0.0 to 10.0.3.255 summarise as the supernet 10.0.0.0/22. Routers use supernets to advertise one route instead of many.

Why does my range turn into several CIDR blocks?

A single CIDR block must start on a boundary that's a multiple of its size. A range that starts or ends elsewhere has to be covered by several blocks of different sizes. The calculator picks the fewest that match exactly.

Does this work for IPv6?

This calculator is IPv4 only. For IPv6 prefixes such as 2001:db8::/48, use the IPv6 subnet calculator, which also compresses and expands addresses.

LightAtom team

The people who build LightAtom, a network monitor for macOS.