IP in CIDR Range Checker

Check whether an IPv4 address falls inside a CIDR range, such as 192.168.1.0/24. Enter the address to check and the range — the result shows a clear yes or no, plus the network address, broadcast address, subnet mask, and host counts. This checker is for IPv4 addresses only. The result updates as you type.

Your address and range

Your result

In this range?—
Network address—
Broadcast address—
Subnet mask—
Total addresses—
Usable hosts—
First usable host—
Last usable host—

Enter an IP address and a CIDR range to see the result.

What Is a CIDR Range?

CIDR, Classless Inter-Domain Routing, is the standard way to write a block of IP addresses. A CIDR range looks like 192.168.1.0/24: the address before the slash is the base of the block, and the number after the slash is the prefix length, which says how many of the 32 bits in an IPv4 address are fixed. The remaining bits are free, so a /24 leaves 8 free bits and holds 256 addresses, while a /16 leaves 16 free bits and holds 65,536 addresses. The network address is the first address in the block, the broadcast address is the last, and the addresses between them are the usable hosts, apart from those two reserved ends.

How the Check Works

The checker turns both the address and the range into 32-bit numbers. It works out the size of the block from the prefix length: 2 raised to the power of 32 minus the prefix. For a /24 that is 2 to the power of 8, which is 256. It then rounds the range base down to the nearest multiple of the block size to find the network address, and adds the block size minus one to find the broadcast address. If the address you entered falls between those two numbers, it is in the range. The subnet mask is built from the same prefix: the first p bits are ones and the rest are zeros, so a /24 mask is 255.255.255.0 and a /16 mask is 255.255.0.0. Usable hosts are the total minus the network and broadcast addresses, except in /31 and /32 ranges, where there are no usable hosts at all.

Worked Example

Example, with the default values. Check 192.168.1.50 against 192.168.1.0/24. The prefix is 24, so the block holds 2 to the power of 8, which is 256 addresses, and the mask is 255.255.255.0. The network address is 192.168.1.0 and the broadcast address is 192.168.1.255. The address 192.168.1.50 sits between them, so the answer is yes. Taking away the network and broadcast addresses leaves 254 usable hosts, from 192.168.1.1 to 192.168.1.254. By contrast, 10.0.0.5 against the same range is a clear no, because 10.0.0.5 is far below 192.168.1.0.

Common Mistakes

Using the network or broadcast address as a host. The first and last addresses in a range are reserved: the network address names the block and the broadcast address talks to every host in it. Neither can be given to a device, so a /24 has 254 usable hosts, not 256.

Reading the prefix backwards. A bigger prefix means a smaller range: /24 holds 256 addresses, while /16 holds 65,536. Each extra bit in the prefix halves the block, so /25 holds 128 addresses and /23 holds 512.

Typing a host address as the range base. Writing 192.168.1.50/24 does not change the range — the network is still 192.168.1.0, because the last 8 bits are host bits. The checker rounds the base down to the real network address, so the result is the same either way.

Forgetting that /31 and /32 have no usable hosts. A /32 names a single address, so the network and broadcast are the same address and there is nothing left to assign. A /31 holds two addresses, both reserved, and is used only for point-to-point links between two routers.

Related Tools

Convert between units with the Unit Converter, work out a percentage with the Percentage Calculator, convert times between zones with the Time Zone Converter, and count the days between two dates with the Date Difference Calculator.

Frequently Asked Questions

What does /24 mean in an IP address?

The /24 is the prefix length: the first 24 of the 32 bits in the address are the network part, and the last 8 bits are the host part. A /24 block holds 256 addresses, from the network address to the broadcast address, with 254 usable hosts in between.

What is the difference between the network address and the broadcast address?

The network address is the first address in the block and names the network itself. The broadcast address is the last address in the block and sends a message to every host on that network. Neither can be assigned to a single device.

Can I check an IPv6 address with this tool?

No. This checker works with IPv4 addresses only, in the familiar four-number dotted form such as 192.168.1.50. IPv6 addresses use a different format with hexadecimal groups separated by colons, and need a separate checker.

How many usable hosts are in a /24 network?

254. A /24 holds 256 addresses in total, but the network address and the broadcast address are reserved, so 256 minus 2 leaves 254 usable hosts, from the first address after the network address to the last address before the broadcast address.

Why does 192.168.1.50/24 still give a network of 192.168.1.0?

Because the /24 prefix fixes the first 24 bits, and the last 8 bits are host bits. Any address from 192.168.1.0 to 192.168.1.255 belongs to the same /24 block, so the network address is always 192.168.1.0 no matter which host address you type before the slash.