Glossary
Plain English
Cross-linked to tools

CIDR

Also known as: Classless Inter-Domain Routing, CIDR notation, slash notation, prefix length

CIDR (Classless Inter-Domain Routing) is the notation that writes a block of IP addresses as an address followed by a slash and the number of fixed leading bits — 192.168.1.0/24 — replacing the rigid class A/B/C system with prefixes of any length.

Overview

The number after the slash is a bit count, not an address count. A /24 means the first 24 bits identify the network and the remaining 8 are free for hosts, giving 2^8 = 256 addresses. Each bit you add to the prefix halves the block, so /25 is 128 addresses and /26 is 64. That inversion is the thing to internalise: a bigger number after the slash means a smaller network.

CIDR arrived in 1993 to replace classful addressing, where a leading octet below 128 meant a /8 and an organisation needing 500 addresses had to be given a /16 worth 65,536. The waste was accelerating IPv4 exhaustion. Allowing an arbitrary prefix meant that organisation could be handed a /23 instead, and it also made route aggregation possible — a router can advertise 10.0.0.0/16 rather than 256 separate /24 routes, which is what kept global routing tables from collapsing under their own weight.

Two addresses in an ordinary IPv4 block are not assignable: the first is the network address naming the subnet, the last is the broadcast address. So a /24 offers 254 usable hosts, not 256. Two prefixes break that rule and are worth knowing: RFC 3021 permits a /31 on a point-to-point link where no broadcast address is needed, so both addresses are usable, and a /32 is a single host route used for loopbacks and firewall rules. Subtracting two regardless is a common bug that yields 0 or -1 usable hosts.

IPv6 uses the same notation with 128 bits instead of 32 and no broadcast address to reserve. A /64 is the conventional size for one link because SLAAC autoconfiguration assumes 64 host bits, and a site is typically delegated a /48 or /56 — leaving room for tens of thousands of /64s, which is why IPv6 subnetting is about hierarchy rather than conservation.

Common questions about CIDR

Does a bigger number after the slash mean a bigger network?
No, the opposite. The number counts bits locked to the network, so raising it leaves fewer bits for hosts and halves the block each time. A /16 holds 65,536 addresses, a /24 holds 256, and a /32 is a single address. If you are thinking about it as address count, invert your intuition.
How do I convert a CIDR prefix to a subnet mask?
Write the prefix length as that many one-bits followed by zeros, then group into octets. A /24 is 24 ones and 8 zeros — 11111111.11111111.11111111.00000000 — which is 255.255.255.0. The one-bits must be contiguous from the left, so a mask like 255.255.0.255 is not valid.
Why does a /24 have 254 usable addresses instead of 256?
The first address identifies the network itself and the last is the broadcast address, so neither can be assigned to a host. The exceptions are a /31, where RFC 3021 allows both addresses on a point-to-point link, and a /32, which is a single host route.
What replaced the old class A, B and C networks?
CIDR did, in 1993. Under classful addressing the prefix was implied by the leading bits, so the only sizes available were /8, /16 and /24 — an organisation needing 500 addresses had to take 65,536. CIDR allows any prefix length, which both reduced that waste and enabled route aggregation. The class labels survive in exam questions and legacy documentation but no longer affect routing.
How is CIDR different in IPv6?
The notation is identical, but the address is 128 bits and there is no broadcast address to set aside. A /64 is the standard single-link size because address autoconfiguration expects 64 host bits, and sites usually receive a /48 or /56 to subdivide. With that much space IPv6 subnetting is about a clean hierarchy rather than squeezing out every address.

Tools that work with CIDR

Subnet Calculator

CIDR and subnet maths for IPv4 and IPv6 — split, plan VLSM, summarise.

Number Base Converter

Convert numbers between binary, octal, decimal, hex and any base.

External references