Skip to main content
toolsxulo

CIDR Calculator

Enter an IPv4 CIDR block, such as 192.168.1.0/24, to see the network address, broadcast address, subnet mask, and usable host range. The page loads with the 192.168.1.0/24 example.

Network address
192.168.1.0
Broadcast address
192.168.1.255
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Total addresses
256
Usable hosts
254

How it works

CIDR notation joins an IPv4 address and a prefix length, for example 192.168.1.0/24. The number after the slash is how many of the address's 32 bits belong to the network; the rest belong to hosts inside that network. A /24 leaves 8 bits, so 256 addresses in total.

From that, the tool computes the network address (host bits set to 0), the broadcast address (host bits set to 1), the subnet mask, the wildcard mask, the first and last usable addresses, and the total and usable address counts. If you enter an address that sits inside the block, such as 192.168.1.50/24, the result is still the 192.168.1.0/24 block, not a subnet that starts at 50.

Up to /30, the tool shows the usable count as the total minus 2, with the network and broadcast addresses set aside. For /31 and /32 it shows a usable count equal to the total: on a /32 all four address cards (network, broadcast, first, and last) are the same single address; on a /31 both addresses are shown as network and broadcast and also as the usable range. The tool accepts IPv4 only, a whole prefix from 0 to 32, and octets with no leading zero.

How to use it

  1. Enter an address in CIDR notation in the "IPv4 address in CIDR notation" field, for example 192.168.1.0/24. That example is already in the field when the page loads.
  2. The eight cards update as you type: network address, broadcast address, subnet mask, wildcard mask, first usable host, last usable host, total addresses, and usable hosts.
  3. If the format is invalid, an error appears under the field and the cards are hidden. Larger counts are shown with the browser locale's thousands separators; the values themselves are the whole numbers in the examples.

Examples

192.168.1.0/24 (the example shown on load)Network address 192.168.1.0, broadcast 192.168.1.255, subnet mask 255.255.255.0, wildcard mask 0.0.0.255, first usable host 192.168.1.1, last usable host 192.168.1.254, total addresses 256, usable hosts 254.
192.168.1.50/24The same results as example 1. 50 sits inside the block, and the tool computes the 192.168.1.0 network, not a block that starts at 50.
192.168.1.0/31Network address 192.168.1.0, broadcast 192.168.1.1, subnet mask 255.255.255.254, wildcard mask 0.0.0.1, first usable host 192.168.1.0, last usable host 192.168.1.1, total addresses 2, usable hosts 2. Unlike /24, the usable count is not reduced by 2, and both addresses are shown as network and broadcast and as the usable range.

Frequently asked

What does the /24 in a CIDR address mean?
It is the prefix length: how many of the 32 bits belong to the network. In a /24 the first 24 bits are fixed, leaving 8 bits, which is 256 addresses. A /16 leaves 16 bits, which is 65,536 addresses, and so on.
Why is the usable host count 2 less than the total?
Up to a /30 prefix, the tool sets aside the network address and the broadcast address, so it shows the total minus 2. For a /24 that is 256 minus 2, or 254. For /31 and /32 it does not do that, and the usable count equals the total.
How does the tool treat /31 and /32 blocks?
On a /32 every address card shows the same single address, for example 10.0.0.1, with a total and usable count of 1. On a /31 it shows two addresses, for example 192.168.1.0 and 192.168.1.1, as both network/broadcast and the usable range, with a total and usable count of 2.
Can I calculate IPv6 CIDR here?
No. The tool only accepts IPv4 in notation such as 192.168.1.0/24, with a whole prefix between 0 and 32.
What if I enter a host address rather than the start of the network?
The tool still computes the block from the prefix. 192.168.1.50/24 returns the same network as 192.168.1.0/24.
Why is 192.168.1.01/24 rejected?
The tool does not accept a leading zero in an octet, so 01 is treated as an invalid address. Write 192.168.1.1/24. Without a slash and prefix, for example 192.168.1.0 alone, you are asked for CIDR notation.

Related tools