CIDR Calculator
CV-25Enter an IPv4 block such as 192.168.1.10/24 to see its network address, broadcast address, netmask, wildcard mask, first and last host and host count. IPv4 only.
Runs in your browser. Nothing is uploaded.
CIDR blocks, one per line (192.168.1.10/24 or 192.168.1.10 255.255.255.0)
Subnet details
How to use it
- Type or paste one block per line, such as 192.168.1.10/24 or 192.168.1.10 255.255.255.0.
- Click Calculate.
- Read the network, netmask, wildcard, broadcast, first and last host, and the host counts for each block.
- Fix any line that shows an error. The message quotes the part that is wrong.
- Copy the result or download it as a text file.
What each result means
The network address is the address with all host bits set to 0, and the broadcast address has them all set to 1. The netmask has 1 bits for the network part, and the wildcard mask is its inverse. For 192.168.1.10/24 the network is 192.168.1.0, the broadcast is 192.168.1.255, the netmask is 255.255.255.0, the wildcard is 0.0.0.255 and the usable hosts run from 192.168.1.1 to 192.168.1.254, which is 254 addresses.
/31 and /32 blocks
In most blocks the network and broadcast addresses cannot be given to hosts, so usable hosts are two fewer than the total. RFC 3021 changes that for /31 point-to-point links, which have 2 usable addresses and no broadcast, and the page shows it that way. A /32 is a single address, shown as one usable host. Check that your own equipment supports it before you plan to use a /31.
Input forms and limits
You can write a prefix length (/24), a netmask after a slash, or a netmask after a space. The netmask must be contiguous, so a wildcard mask such as 0.0.0.255 is rejected instead of being guessed. The address can have host bits set, and it is shown as its network. IPv6 is not supported, and the page does not name private or reserved ranges.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Prefix length "33" must be a whole number from 0 to 32. | The number after the slash is outside the IPv4 range. | Use a prefix from 0 to 32. |
"255.0.255.0" is not a valid netmask. The 1 bits must come first, with no gaps (for example 255.255.255.0). | The mask has 1 bits after a 0 bit, or is a wildcard mask. | Use a contiguous netmask such as 255.255.255.0, or write the prefix length. |
"192.168.1.10" needs a prefix length or netmask, such as 192.168.1.10/24 or 192.168.1.10 255.255.255.0. | The line has an address but no mask. | Add /24 or a netmask after the address. |
Questions people ask
How do I calculate the network address from an IP and /24?
Keep the first 24 bits of the address and set the rest to 0. For 192.168.1.10/24 the network address is 192.168.1.0. Paste the block into the box and click Calculate to see all of the values.
How many usable hosts are in a /24?
254. A /24 has 256 addresses, and the first (network) and last (broadcast) are not given to hosts. A /30 has 2 usable hosts, and a /31 has 2 with no broadcast, as RFC 3021 allows.
What is a wildcard mask?
The wildcard mask is the netmask with every bit flipped. For 255.255.255.0 it is 0.0.0.255. Some router and firewall rule formats use it to say which bits of an address can vary.
What does a /31 mean?
A /31 holds two addresses and is used for point-to-point links. Under RFC 3021 both addresses are usable and there is no broadcast address. Not every device supports this, so confirm on yours.
Can I enter a netmask instead of a prefix?
Yes. Write 172.16.5.4 255.255.240.0 or 172.16.5.4/255.255.240.0 and the page works out the prefix for you. The mask must be contiguous, so a wildcard mask is rejected. That example works out to a /20.
Does it support IPv6 subnets?
No. The page only works on IPv4 and does not read IPv6 prefixes. For IPv6 text forms, the IPv6 expander and compressor page expands and shortens single addresses.
About this tool
IPv4 only; IPv6 prefixes are not handled. Each line is an address with a prefix length (/24), a netmask after a slash (/255.255.255.0) or a netmask after a space. A netmask must be contiguous, so a wildcard mask such as 0.0.0.255 is rejected rather than guessed. The network address comes from clearing the host bits, so a host address such as 192.168.1.10/24 is accepted and shown as 192.168.1.0/24. For /30 and larger blocks, the first and last addresses are the network and broadcast addresses and are not counted as usable hosts. A /31 has two usable addresses and no broadcast (RFC 3021 point-to-point links), and a /32 is one host. Reserved or private range names are not shown.