CIDR notation explained
The slash and number after an IP address, as in 203.0.113.0/24, say how big a block of addresses is. Here is how to read it, a chart of every IPv4 prefix length, and what the same notation means in IPv6.
In this guide
CIDR notation writes a network as an address followed by a slash and a prefix length, for example 203.0.113.0/24. The number is how many bits from the left identify the network; the remaining bits identify hosts within it. A /24 has 8 host bits, so 256 addresses (254 usable), and corresponds to the subnet mask 255.255.255.0. A /32 is a single address.
How to read CIDR notation
An IPv4 address is 32 bits, usually written as four numbers from 0 to 255. CIDR notation adds a slash and a count: how many of those bits, starting from the left, are fixed for everything in the block. The rest are free to vary, and each combination of the free bits is one address.
So 203.0.113.0/24 means: the first 24 bits (203.0.113) are fixed, the last 8 bits vary, and the block runs from 203.0.113.0 to 203.0.113.255. The first address of any block is its network address and the last is its broadcast address, so on an ordinary LAN two of the 256 are not usable by hosts, leaving 254.
The address before the slash is normally the start of the block, with all host bits zero. When it is not, as in 203.0.113.42/24, the notation describes a host and the block it sits in: host 42 of the 203.0.113.0/24 network. Both forms are common. Configuration files use the host form (192.168.1.23/24 on an interface); routing tables and firewall rules use the block form.
Three rules make the arithmetic quick:
- Every bit you add to the prefix halves the block; every bit you remove doubles it. A /25 is half a /24; a /23 is two /24s.
- The number of addresses is 2 to the power of (32 minus the prefix). A /26 has 2⁶ = 64.
- Blocks start on multiples of their own size. A /26 can start at .0, .64, .128 or .192, never at .100, which is why
203.0.113.100/26describes a host inside203.0.113.64/26, not a block starting at .100.
The slash number and the subnet mask are the same information in two spellings. A mask is the prefix written out as 32 bits: /24 is twenty-four ones followed by eight zeros, which in dotted form is 255.255.255.0. What is a subnet mask? goes through the conversion; the subnet calculator does it for you and also prints the network, broadcast and usable range.
CIDR stands for Classless Inter-Domain Routing. It replaced the original scheme of fixed Class A, B and C sizes in 1993 for two reasons: blocks could be sized to need instead of being wasted, and a provider could announce one summary route for all its customers instead of hundreds. The IP address classes guide covers what it replaced and where the old vocabulary still turns up.
CIDR chart: /8 to /32
Usable hosts assumes an ordinary subnet with a network and a broadcast address. Two special cases: a /31 is used on point-to-point links with both addresses usable, and a /32 is a single host.
| Prefix | Subnet mask | Addresses | Usable hosts | Typical use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | A whole former Class A; 10.0.0.0/8 is the private one |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 | |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 | 100.64.0.0/10 is the carrier-grade NAT range |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 | |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | 172.16.0.0/12 is the middle private range |
| /13 | 255.248.0.0 | 524,288 | 524,286 | |
| /14 | 255.252.0.0 | 262,144 | 262,142 | |
| /15 | 255.254.0.0 | 131,072 | 131,070 | |
| /16 | 255.255.0.0 | 65,536 | 65,534 | A former Class B; 192.168.0.0/16 and 169.254.0.0/16 |
| /17 | 255.255.128.0 | 32,768 | 32,766 | |
| /18 | 255.255.192.0 | 16,384 | 16,382 | |
| /19 | 255.255.224.0 | 8,192 | 8,190 | |
| /20 | 255.255.240.0 | 4,096 | 4,094 | |
| /21 | 255.255.248.0 | 2,048 | 2,046 | |
| /22 | 255.255.252.0 | 1,024 | 1,022 | A common small-ISP or campus allocation |
| /23 | 255.255.254.0 | 512 | 510 | Two /24s joined |
| /24 | 255.255.255.0 | 256 | 254 | The typical home or office LAN; a former Class C |
| /25 | 255.255.255.128 | 128 | 126 | |
| /26 | 255.255.255.192 | 64 | 62 | |
| /27 | 255.255.255.224 | 32 | 30 | |
| /28 | 255.255.255.240 | 16 | 14 | A small block of public addresses for a business |
| /29 | 255.255.255.248 | 8 | 6 | Typical static-IP business line |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point links, older style |
| /31 | 255.255.255.254 | 2 | 2 | Point-to-point links; no network or broadcast address |
| /32 | 255.255.255.255 | 1 | 1 | A single host; what firewall rules and route tables use |
Prefixes shorter than /8 exist but describe aggregates rather than networks: 0.0.0.0/0 is "every address", which is how a default route is written, and regional registries hold blocks such as /8s to carve up for providers. The CIDR to IP range converter turns any block into its first and last address, and back.
Worked examples
A home network. The router says its LAN is 192.168.1.0/24. Hosts can use 192.168.1.1 through 192.168.1.254; the router usually takes .1, and 192.168.1.255 is the broadcast address. The local IP tool shows which of those your device holds.
Splitting a block. A company with 198.51.100.0/24 wants four separate networks. Four is 2², so it borrows 2 host bits and gets four /26s: 198.51.100.0/26, .64/26, .128/26 and .192/26, each with 62 usable addresses.
Joining blocks. An office uses 192.168.0.0/24 and 192.168.1.0/24 and wants them to be one network. They are adjacent and the first starts on an even boundary, so together they are 192.168.0.0/23: 512 addresses, one subnet. Providers do the same at a larger scale, announcing one summary route for all their customers' blocks; that is the aggregation CIDR was designed for.
A firewall rule. "Allow SSH from 203.0.113.42/32" permits exactly one address. "Allow from 203.0.113.0/24" permits all 256. Writing /32 rather than the bare address is a habit worth keeping, because some tools treat a bare address with a missing prefix as a /0 and allow everyone.
A lookup result. When the IP lookup or WHOIS shows that an address belongs to the block 203.0.113.0/25, every address from 203.0.113.0 to 203.0.113.127 has the same owner, which is what tells you that two different-looking addresses came from one network.
Test it now
Cloudflare edgeRead at the Cloudflare edge from this request. The homepage adds your provider, network type and the VPN, DNS and WebRTC checks.
Show detailsIPv6 prefixes
IPv6 uses the same slash notation on 128-bit addresses, so the numbers are bigger and the habits are different. Nobody counts usable hosts in IPv6; a single subnet is a /64 with 2⁶⁴ addresses, and address autoconfiguration requires that size. Prefixes describe how many subnets you have, not how many hosts.
| Prefix | What it usually is |
|---|---|
/128 | A single address, the IPv6 equivalent of /32 |
/127 | A point-to-point link between two routers |
/64 | One subnet: one LAN, one Wi-Fi network, one VLAN |
/56 | A common home assignment: 256 subnets of /64 |
/48 | A common business or campus assignment: 65,536 subnets |
/32 and shorter | What registries allocate to internet providers |
2000::/3 | The range from which all current global addresses are assigned |
fe80::/10 | Link-local addresses, present on every interface |
2001:db8::/32 | Reserved for documentation and examples |
The number itself is the only thing that carries over cleanly: a shorter prefix is still a bigger block, each bit still halves or doubles it, and the subnet calculator handles both families. What changes is scale. A home that got a single /24 in IPv4, 254 addresses, typically gets a /56 in IPv6, which is 256 networks each larger than the entire IPv4 internet. The IPv6 test shows whether your connection has one, and IPv4 vs IPv6 explains the rest of the differences.
Questions
Can you explain CIDR for a beginner?
Think of an address as a street name plus a house number. CIDR's slash number says how much of the address is the street. In 192.168.1.0/24, the first three numbers are the street and the last number is the house, so the street has 256 possible houses. A bigger slash number means a shorter street with fewer houses; /32 is one house on its own.
What does /24 mean in CIDR notation?
That the first 24 of the 32 bits are the network part, leaving 8 bits, or 256 addresses, for hosts, of which 254 are usable. It corresponds to the subnet mask 255.255.255.0, and it is the size of a typical home or office network: 192.168.1.0/24 covers 192.168.1.0 through 192.168.1.255, with .0 as the network address and .255 as broadcast.
What does a /32 CIDR mean?
A block containing exactly one address: all 32 bits are fixed, so nothing can vary. The mask is 255.255.255.255. You see it in firewall rules and routing tables where a single host is meant, for example "allow 203.0.113.42/32". In IPv6 the equivalent is /128; an IPv6 /32 is a huge allocation given to an internet provider, not one host.
What is 255.255.255.255 in CIDR?
/32. The mask has all 32 bits set, so every bit of the address is network and none is host, which leaves a single address. The other common masks map the same way: 255.255.255.0 is /24, 255.255.0.0 is /16, 255.0.0.0 is /8, and 255.255.255.252 is /30. Count the one-bits in the mask and you have the prefix length.
What does CIDR notation represent?
A range of IP addresses that share a common beginning, written as the first address plus the number of shared bits. It represents networks, allocations and rules compactly: 10.0.0.0/8 is sixteen million addresses in nine characters. It also replaced the old class system, letting blocks be any power-of-two size and letting providers announce one route for many customers.