Calxo Learn

Learn the concept. Understand the formula. Calculate the result.

Lesson 2 of 4 · 6 min

CIDR notation explained

Turn a slash prefix into a subnet mask, address count, and usable host range.

By Calxo AI · Updated

That little slash is doing a lot of work

You’ve probably seen an address followed by /24 or /26. Good news: the slash number isn’t another formula to memorise. It simply counts how many bits belong to the network.

IPv4 has 32 bits. With /26, we use 26 for the network and have six left for hosts. The name for this notation is CIDR, short for Classless Inter-Domain Routing. For now, focus on the bit count rather than the long name.

Here’s the useful pattern: add one network bit and each block gets cut in half.

Picture it
/24
256 addresses
↓ add one network bit
/25
128128
↓ add one more
/26
64646464
Each /26: 64 total − 2 reserved = 62 usable
For a conventional IPv4 broadcast subnet.
Every extra network bit cuts a block in half. A larger slash number means a smaller block.

One small distinction: 192.168.1.70/26 describes an address with its prefix. The block it belongs to is 192.168.1.64/26. Use the network address when naming the whole block, such as in an address plan or route.

Count the possibilities, then save two spots

Each host bit has two possibilities: 0 or 1. Two bits give four combinations; three give eight. Every extra host bit doubles the choices. With six host bits, that makes 2^6 = 64 addresses. The little ^ means “raised to the power of”.

/26 → 32 − 26 = 6 host bits
Total addresses = 2^6 = 64
Conventional usable hosts = 64 − 2 = 62

Why subtract two? On an ordinary broadcast subnet, the first address names the network, and the last is its broadcast address. They already have jobs, so we leave them out of the host count. That turns 64 total addresses into 62 usable host addresses.

Prefixes you will use often

Conventional IPv4 broadcast subnet sizes
PrefixSubnet maskTotal addressesUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

Use the table as a quick reference, not a memory test. If you forget a row, rebuild it: host bits = 32 − prefix, then total addresses = 2^(host bits). Subtract two for conventional usable hosts.

Which block does .70 call home?

Let’s place 192.168.1.70/26. Each /26 has 64 addresses. Inside this /24, the blocks start at 0, 64, 128, and 192. Since 70 lands between 64 and 127, it belongs to 192.168.1.64/26.

Picture it
192.168.1.64/26
Network.64Reserved
Usable hosts.65 → .12662 addresses · .70 lives here
Broadcast.127Reserved
All addresses above begin with 192.168.1.
Address 192.168.1.70 sits inside the usable range. The two end addresses have special jobs on this conventional broadcast subnet.
  1. Network address: 192.168.1.64.
  2. Last address: 64 + 64 − 1 = 127, giving broadcast address 192.168.1.127.
  3. First usable host: 192.168.1.65.
  4. Last usable host: 192.168.1.126.

Watch that final +64 − 1. We include the starting address when counting, so our block ends at .127. Address .128 is already the start of the next block. Off-by-one mistakes happen to everyone; checking the next boundary is a handy way to catch them.

Two exceptions worth keeping in your toolkit

The “subtract two” rule has limits. On a supported /31 point-to-point link, both addresses can be endpoints. RFC 3021 defines this arrangement without separate network and directed-broadcast reservations. Think of a link joining two endpoints, rather than an ordinary office LAN.

A /32 picks out one exact IPv4 address, often for a host route or loopback interface. There’s no sense subtracting two from one! At the opposite end, /0 covers all IPv4 address space and is used for a default route. That doesn’t mean every address in it can be assigned to a device.

Common mistakes

  • Assuming the number after the slash is a host count.
  • Forgetting that a longer prefix means fewer addresses.
  • Applying the /24 last-octet shortcut to a prefix such as /20, whose boundary crosses an earlier octet.
  • Using the conventional usable-host count as a guarantee from a cloud provider. Providers can reserve additional addresses.

Try it yourself

IPv4 subnet explorer

Change the address or prefix. Watch the network bits and host range update.

11000000101010000000000101000110

Blue = network bits (26). Amber = host bits (6).

Network
192.168.1.64/26
Subnet mask
255.255.255.192
Total addresses
64
Usable host addresses
62
Host range
192.168.1.65 – 192.168.1.126
Broadcast address
192.168.1.127

6 host bits → 2^6 = 64 addresses → 62 usable after the network and broadcast reservations. This is address arithmetic; special-use ranges and your network configuration may impose other restrictions.

Open the full subnet calculator →

Check your understanding

Choose an answer for every question, then check your work. You can retry as often as you like.

1. How many host bits are left in an IPv4 /26?
2. How many usable host addresses are in a conventional /26 subnet?

0 of 2 answered.

Sources and scope

These lessons explain IPv4 address arithmetic using IETF specifications. Host counts use conventional network and broadcast reservations, with /31 and /32 exceptions. Address availability also depends on special-use ranges, provider rules, and your configuration.

How Calxo reviews its content