What CIDR notation is
CIDR (Classless Inter-Domain Routing) represents a subnet as an IP address followed by a slash and the number of netmask bits (e.g. 192.168.1.0/24 means the first 24 bits identify the network, and the remaining 8 bits identify hosts).
What it's for
Essential for configuring networks, firewalls and routing rules: knowing how many hosts fit in a subnet, what the broadcast address is, and what the usable IP range is.
Example with 192.168.10.0/26
A /26 leaves 6 bits for hosts, so there are 64 addresses: from 192.168.10.0 (network) to 192.168.10.63 (broadcast), with 62 usable hosts, .1 through .62. The matching mask is 255.255.255.192. To split a /24 into four equal networks, use /26.
Sizing pitfalls
The general formula is 2 to the power of (32 minus the prefix), minus 2 reserved addresses. If the address you enter is not the start of a network, such as 192.168.10.77/26, the result is normalized to the network that contains it (192.168.10.64). Cloud providers often reserve a few extra addresses in each subnet, so check their documentation before sizing right at the limit.
Frequently asked questions
Why don't /31 and /32 have "usable" hosts in the traditional sense?
A /32 subnet has only 1 address (used for single-host routes), and a /31 has 2 addresses, both usable point-to-point (RFC 3021) — there are no reserved network/broadcast addresses in these cases.
Does this tool work with IPv6?
No — for now it only calculates IPv4 subnets.
How do I tell whether an IP belongs to a subnet?
Compare the prefix: 10.0.5.20 belongs to 10.0.4.0/22 because that network spans 10.0.4.0 to 10.0.7.255, while 10.0.8.1 falls outside. Work out the network range and check whether the IP sits between the first and last address.
What is the difference between /24 and the mask 255.255.255.0?
None: they are two ways to write the same thing. The number after the slash counts the 1 bits in the mask, and 24 set bits equal 255.255.255.0. Masks like /20 do not end in a round zero (255.255.240.0), so slash notation is more practical.