Tools / IP range to CIDR

IP range to CIDR calculator

Convert an IP range to CIDR, or a CIDR block to its IP range. Everything runs in your browser.

Find the network mask that covers a range of IP addresses.

CIDR to IP range: enter a CIDR block such as 192.168.1.0/24 to see its first and last address.

Privacy: we do not store what you enter. This calculator runs entirely in your browser.

CIDR to IP range

A CIDR block such as 192.168.1.0/24 stands for a range of addresses. The number after the slash is how many bits are fixed. A /24 fixes 24 bits and leaves 8 bits free, so it holds 256 addresses: 192.168.1.0 to 192.168.1.255.

To find the range by hand: the network address is the first address, and the last address is the first one plus the block size, minus 1. For 10.0.0.0/8 the range is 10.0.0.0 to 10.255.255.255.

Common CIDR blocks

CIDRSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/23255.255.254.0512510
/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
/32255.255.255.25511

Usable hosts are the total minus the network and broadcast addresses. A /31 (2 addresses) is used for point-to-point links, and a /32 is a single address.

How IP range to CIDR works

A CIDR block is a network whose size is a power of two and whose start address lines up with that size. The calculator finds the smallest block that contains both of your addresses, then tells you whether the range matches that block exactly.

For example, 192.168.1.0 to 192.168.1.255 is exactly 192.168.1.0/24 with the mask 255.255.255.0.

When the range does not fit exactly

Many ranges are not a single block. The calculator then returns a larger block that covers the whole range plus extra addresses. If you need an exact match, split the range into several smaller blocks, for example for firewall rules.

Common questions

How do I convert a CIDR to an IP range?

Enter the CIDR block, for example 192.168.1.0/24, in the CIDR to IP range box above. The first address is the network address, and the last is the broadcast address.

What is the IP range of 192.168.1.0/24?

192.168.1.0 to 192.168.1.255, which is 256 addresses and 254 usable hosts.

How many IP addresses are in a /24?

A /24 has 256 addresses in total and 254 usable hosts.

How do I convert an IP range to CIDR?

Enter the first and last address in the IP range box. The calculator returns the smallest single block that covers both. If the range is not exactly one block, split it into several smaller blocks for an exact match.

What is a wildcard mask?

It is the inverse of the subnet mask, for example 0.0.0.255 for a /24. Some routers and firewalls use it in access lists.

Need host ranges and usable addresses?

Use the subnet calculator, which starts from an address and a prefix.

Related tools and guides

Results are for guidance only. See all network tools.