What is CIDR notation?
CIDR notation is the short way of writing a block of IP addresses: an address, a slash, and a number, like 192.168.1.0/24. The number after the slash says how many bits at the start of the address are fixed for the network. Everything after that is free for devices. Bigger number = smaller block. To see any block worked out instantly, type it into the subnet calculator.
The slash number in one sentence
An IPv4 address has 32 bits. /24 means “the first 24 bits are the network”, which leaves 32 − 24 = 8 bits for devices, so the block holds 28 = 256 addresses. Every time the number goes up by one, the block halves; every time it goes down by one, it doubles.
Quick table: CIDR to subnet mask and size
| CIDR | Subnet mask | Addresses | Usable devices |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /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 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /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 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /32 | 255.255.255.255 | 1 | 1 (a single address) |
“Usable devices” is two less than the size, because in IPv4 the first address names the network and the last is the broadcast address. Every row from /8 to /32 is in the subnet mask cheat sheet.
First and last IP address in a CIDR range
A block always starts at the network address and runs for its size. Some worked examples (click one to see it in the calculator):
192.168.1.0/24→ 192.168.1.0 to 192.168.1.255 (devices use .1 to .254).192.168.0.0/22→ 192.168.0.0 to 192.168.3.255: four /24s glued together.172.16.0.0/20→ 172.16.0.0 to 172.16.15.255.10.0.0.0/8→ 10.0.0.0 to 10.255.255.255, the biggest private block.
Quick rule: if the slash number is between 17 and 24, the third number grows by 2(24 − slash), so a /22 covers 4 values of the third number and a /20 covers 16. To cut a block into smaller pieces (for example a /24 into four /26s), use “Split into” on the subnet calculator.
How to turn a subnet mask into CIDR (and back)
Write each part of the mask as 8 bits and count the 1s. 255 is 11111111 (8 ones), 255 is 8, 255 is 8, 0 is 0: 8 + 8 + 8 + 0 = /24. For 255.255.255.192: 192 is 11000000, two ones, so 24 + 2 = /26. The only values you’ll ever see in a mask are 0, 128, 192, 224, 240, 248, 252, 254 and 255 (0 to 8 ones). Going the other way, /20 = 8 + 8 + 4, so the mask is 255.255.240.0.
Where you’ll see CIDR notation
- Your home router: the LAN is almost always
192.168.0.0/24,192.168.1.0/24or10.0.0.0/24, shown as “subnet mask 255.255.255.0”. - Firewall and port-forwarding rules: “allow 41.0.0.0/16” means everything from 41.0.0.0 to 41.0.255.255.
- Cloud networks (AWS VPC, Azure VNet, Google Cloud): you pick a block like
10.0.0.0/16and cut it into /24 subnets. - ISP and IP-owner records: WHOIS and IP lookup show the network block an IP belongs to, e.g. a South African ISP’s range on our SA ISP pages.
- Special ranges: private blocks
10.0.0.0/8,172.16.0.0/12and192.168.0.0/16(see public vs private IP) and the CGNAT block100.64.0.0/10(see what is CGNAT).
CIDR for IPv6
IPv6 works exactly the same way, just with 128 bits and no dotted mask. /64 is one network (the size every LAN should be), a /56 holds 256 of those and a /48 holds 65,536. ISPs usually give a home or business a /56 or /48. The IPv6 subnet calculator lists every /64 inside your block.
Common mistakes
- Host bits set:
192.168.1.50/24is a device inside the network, not the network itself (that’s 192.168.1.0/24). The calculator points this out. - Blocks must start on a boundary: a /26 can only start at .0, .64, .128 or .192.
- Bigger number ≠ bigger network: /28 is far smaller than /24.
Frequently asked questions
What does /24 mean in an IP address?
It means the first 24 of the 32 bits are the network part. That leaves 8 bits, so the block has 256 addresses (254 usable devices), and the subnet mask is 255.255.255.0.
Why is it called CIDR?
CIDR stands for Classless Inter-Domain Routing, introduced in 1993. Before it, networks came in fixed “class” sizes (A, B and C). CIDR lets a block be any size, written with the slash number.
Is CIDR the same as a subnet mask?
They describe the same thing in two ways. /24 and 255.255.255.0 are identical; CIDR is just shorter and also works for IPv6, which doesn’t use dotted masks.
How many IP addresses are in a /22?
A /22 has 1,024 addresses (2 to the power 10), of which 1,022 are usable for devices in IPv4. Its mask is 255.255.252.0, and it covers four /24 networks, for example 192.168.0.0 to 192.168.3.255.
What does 0.0.0.0/0 mean?
It means every IPv4 address. You see it as the default route on routers (send anything not local this way) and in firewall rules, where 0.0.0.0/0 means anyone on the internet. The IPv6 version is ::/0.
What is a /32 in CIDR?
A /32 is a single IPv4 address: all 32 bits are fixed, so the block holds exactly one address. Firewall and allow-list rules use it to mean just this one IP, for example 203.0.113.5/32. In IPv6 the same idea is /128.
How many IP addresses are in a /16?
A /16 has 65,536 addresses (2 to the power 16), of which 65,534 are usable for devices in IPv4. Its mask is 255.255.0.0.
More guides
- What is IPv6?
- How to find your IP address (every device)
- Public vs private IP address
- What is CGNAT (carrier-grade NAT)?
- How to hide your IP address
- How to find your PS5 IP address
- How to find your Xbox IP address
- How to find your smart TV’s IP address
- How to find your router’s IP address
- What is a good internet speed?
- Why is my internet slow at night?
- How to change DNS on Windows 11 and 10
- How to change DNS on a Mac
- How to change DNS on your router
- Public DNS servers compared
- Why port forwarding isn’t working
- Keeping your internet on during load-shedding
- Fibre vs LTE vs 5G in South Africa
- How to check if a port is open
- How to create a strong password
- What is a user agent?
- How to find your MAC address
- What is a good ping?
- Subnet mask cheat sheet (CIDR table)
- How to find who owns an IP address
- How to find who owns a domain
- How to flush your DNS cache
- How to check if an IP address is a VPN
- What is an ASN (autonomous system number)?
- How to fix DNS_PROBE_FINISHED_NXDOMAIN
- How to set up DMARC (step by step)
- Why are my emails going to spam?
- How to spot WhatsApp and SMS scams
- How to fix SPF “too many DNS lookups”
- What to do if you’ve been scammed (South Africa)
- How to view full email headers
- How to tell if an email is fake
- IPv6 subnet cheat sheet (prefix chart)
- What is an IP address?