← All tools

CIDR to IP Range Converter

Convert CIDR notation to an IP range with subnet mask and host count, or turn any IP range into the shortest list of CIDR blocks. A free CIDR calculator for IPv4 and IPv6.

One CIDR block per line, up to 1,000.
Try:

How CIDR notation works

CIDR notation writes a network as an address, a slash and a prefix length, for example 192.168.1.0/24. The prefix length is the number of leading bits shared by every address in the network; the remaining bits number the addresses inside it. A /24 leaves 8 bits, so the block holds 28 = 256 addresses, from 192.168.1.0 to 192.168.1.255.

In an IPv4 subnet the first address identifies the network itself and the last one is the broadcast address, which leaves 254 addresses for hosts in a /24.

How to convert an IP range to CIDR

Switch to Range to CIDR and enter the first and the last address of the range. A range that is exactly one network gives a single block: 10.0.0.0 - 10.0.0.255 is 10.0.0.0/24. Any other range is split into the shortest list of CIDR blocks that covers it without a single extra address, ready for a firewall rule or an access list. To see the borders of a block as plain numbers, use the IP to number converter.

CIDR cheat sheet: IPv4 prefixes and subnet masks

PrefixNetmaskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/12255.240.0.01,048,5761,048,574
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511
FAQ

Frequently asked questions

What is the difference between addresses and usable hosts?

The address count covers every address in the block. In IPv4 the first address is the network address and the last one is the broadcast address, so the hosts you can assign are the total minus two. IPv6 has no broadcast address, so for IPv6 the tool shows the first and last address and the total.

How are /31 and /32 blocks handled?

A /32 is a single address. A /31 holds two addresses and is used for point-to-point links (RFC 3021): both can be assigned, so the tool counts 2 usable hosts.

Why does one IP range turn into several CIDR blocks?

A CIDR block holds a power-of-two number of addresses and must start on a boundary that matches its size. A range that does not fit is split into the shortest list of blocks that covers it exactly: 192.168.0.5 - 192.168.0.20 becomes five blocks.

Is the data I enter sent to your server?

No. The conversion runs entirely in your browser: nothing is transmitted or stored.

How many IP addresses are in a /24?

A /24 holds 256 addresses, 254 of them usable for hosts. Every bit taken from the prefix doubles the block: a /23 has 512 addresses, a /16 has 65,536 and a /8 has 16,777,216. The formula is 232 − prefix for IPv4 and 2128 − prefix for IPv6.

How do I convert a subnet mask to CIDR?

Count the one-bits of the mask. 255.255.255.0 is 24 ones followed by 8 zeros, so it equals /24; 255.255.240.0 is /20. The converter also accepts the mask directly: 192.168.1.0/255.255.255.0.

What is a wildcard mask?

A wildcard mask is the subnet mask inverted: 0.0.0.255 for a /24. Cisco access lists and OSPF configuration use it to mark the bits that may differ.