Use CIDR notation for network ranges
CIDR (Classless Inter-Domain Routing) compactly represents IP ranges. Learn prefix lengths, subnet masks, and how to check if an IP is in a range.
- 1
CIDR notation (IP/prefix) replaces classful addressing. /8 = 16M hosts (former class A), /16 = 65K (class B), /24 = 256 (class C), /32 = 1 host. The prefix determines the subnet mask: /24 → 255.255.255.0, /16 → 255.255.0.0. To check if an IP is in a CIDR range, AND the IP with the mask and compare to the network address.
- 2 IP Address Info →
Enter a CIDR block (e.g., 10.0.0.0/8) to see the subnet mask, wildcard mask, network and broadcast addresses, and total addresses. This is useful for firewall rules and access control lists.
- 3 Precision Calculator →
Convert a prefix length to a subnet mask. /20 → 255.255.240.0. The first 20 bits are 1, the rest are 0. In binary: 11111111.11111111.11110000.00000000. The wildcard mask is the inverse: 0.0.15.255.
Frequently asked questions
- How do I check if an IP is in a CIDR range?
- Convert the IP and network address to 32-bit integers. AND both with the subnet mask. If the results are equal, the IP is in the range. For example, 192.168.1.100 AND 255.255.255.0 = 192.168.1.0, which matches the network 192.168.1.0/24.
- What is the smallest useful subnet?
- /30 gives 2 usable hosts (4 addresses minus network and broadcast) — used for point-to-point links between routers. /31 (RFC 3021) gives 2 hosts with no broadcast, used for point-to-point in modern networks. /32 is a single host (host route).
Learn more
Want to understand why?