Need network, broadcast, and usable hosts without doing the binary by hand? Enter an IPv4 address and a prefix or dotted mask above, then copy the CIDR. This IPv4 CIDR calculator is part of the networking tools on TechOpt.io. There is also an IPv6 CIDR calculator and a dual-stack CIDR calculator.
How this IPv4 CIDR calculator reads prefix length
An IPv4 address is 32 bits, usually written as four decimal octets. CIDR adds a prefix length after a slash, as described in RFC 4632: 192.168.1.0/24 means the first 24 bits are the network and the last 8 bits identify a host. The same network with a dotted mask is 192.168.1.0 plus 255.255.255.0.
The calculator also shows the wildcard mask (the inverse of the subnet mask), which shows up in Cisco ACLs, and the usable range after subtracting network and broadcast.
Common IPv4 prefix lengths
| Prefix | Mask | Usable hosts | Typical use |
|---|---|---|---|
/8 | 255.0.0.0 | 16,777,214 | Legacy class A, or RFC1918 10.0.0.0/8 |
/16 | 255.255.0.0 | 65,534 | Campus or lab block, or 192.168.0.0/16 |
/24 | 255.255.255.0 | 254 | Home LAN, VLAN, or guest Wi-Fi |
/31 | 255.255.255.254 | 2 | Point-to-point links (RFC 3021) |
/32 | 255.255.255.255 | 1 | A single host or loopback |
Private and special ranges
RFC1918 private space is 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Carrier-grade NAT uses 100.64.0.0/10. Link-local (APIPA) is 169.254.0.0/16. Documentation examples should stay in TEST-NET (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24). The flags above tell you which bucket an address falls into.
FAQ
What is CIDR notation?
CIDR writes an IPv4 address and a prefix length, such as 192.168.1.0/24. The number after the slash is how many leading bits are the network. /24 is the same as mask 255.255.255.0: 24 network bits and 8 host bits.
How many usable hosts are in a /24?
A /24 has 256 addresses. Subtract network and broadcast and you get 254 usable hosts, from .1 through .254. That is the usual size of a home LAN or a small VLAN.
What is a wildcard mask?
A wildcard mask is the inverse of the subnet mask. 255.255.255.0 inverts to 0.0.0.255. Cisco ACLs and some OSPF network statements use wildcards instead of prefix length.
What is the difference between /31 and /32?
A /32 is a single host. A /31 (RFC 3021) is a point-to-point link with two usable addresses and no broadcast. Use /31 on router-to-router links when you do not want to spend a whole /30.
Does this IPv4 calculator upload my addresses?
No. It runs entirely in your browser. Addresses and masks never leave your machine.
Looking for more networking how-tos? Browse the servers and networking guides or the rest of the tools.