Understanding CIDR Notation
CIDR (Classless Inter-Domain Routing) notation writes an IPv4 address together with a prefix length, like 192.168.1.0/24. The prefix length — the number after the slash — states how many of the address's 32 bits are fixed as the "network" portion; the remaining bits identify individual hosts within that network. CIDR replaced the older class-based (A/B/C) system in 1993, letting networks be sized to the number of hosts actually needed instead of fixed 8-, 16-, or 24-bit blocks.
The formulas
For an address with prefix length n (0–32), the calculator applies standard bitwise arithmetic:
- Subnet mask: n leading 1-bits followed by (32 − n) trailing 0-bits, written in dotted-decimal (e.g. /24 → 255.255.255.0).
- Network address: the entered IP address with a bitwise AND against the subnet mask (all host bits forced to 0).
- Broadcast address: the network address with all host bits forced to 1 (a bitwise OR against the wildcard mask).
- Total addresses: 2^(32 − n) — every address in the block, including network and broadcast.
- Usable hosts: 2^(32 − n) − 2 for prefixes /0 through /30, since the network and broadcast addresses cannot be assigned to a host. The exceptions are /31, where RFC 3021 permits both addresses to be used on point-to-point links, and /32, a single host route.
Common prefix reference
- /8 — 16,777,216 addresses, 16,777,214 usable hosts (mask 255.0.0.0).
- /16 — 65,536 addresses, 65,534 usable hosts (mask 255.255.0.0).
- /24 — 256 addresses, 254 usable hosts (mask 255.255.255.0) — the most common LAN subnet size.
- /30 — 4 addresses, 2 usable hosts (mask 255.255.255.252) — a classic router-to-router link.
- /32 — 1 address, used as a host route.
Private and reserved ranges
RFC 1918 sets aside three blocks for private, non-internet-routable networks: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Addresses outside these blocks (and outside other reserved ranges like 127.0.0.0/8 for loopback and 169.254.0.0/16 for link-local) are generally public, internet-routable addresses.