Digital Drive HQ

What Is CIDR Notation? What the Slash in an IP Address Means

·7 min read

What is CIDR notation? It is a way of writing an IP address plus the size of its network in one string, like 192.168.1.0/24. The slash number is how many leading bits are the network portion. So /24 means the first 24 of 32 bits identify the network, and the last 8 identify hosts inside it. That is the entire concept. Everything else is arithmetic that follows from it.

CIDR stands for Classless Inter-Domain Routing. The name is a mouthful. The idea is not.

What does the slash mean in an IP address?

The slash means "count the network bits." Nothing more.

An IPv4 address is 32 bits long. You see it as four numbers separated by dots, like 192.168.1.10, but that formatting is for humans. Each of those four numbers is an 8-bit octet. Four octets, 8 bits each, 32 bits total.

Those 32 bits get split into two parts:

  • The network portion. The leading bits. Every device on the network shares these exact bits.
  • The host portion. The trailing bits. These vary from device to device and identify individual machines.

The prefix, that slash number, is the dividing line. It says where the network portion stops and the host portion begins. In 192.168.1.0/24, the line falls after bit 24. The first 24 bits (192.168.1) are fixed for every device on that network. The last 8 bits are free to change, which is what gives you room for hosts.

Because there are 32 bits, the prefix can be anything from /0 to /32. A /0 fixes nothing. A /32 fixes everything. Everything useful sits between.

If you want to see this split for a specific address without doing the binary by hand, run it through the IP Subnet Calculator and read off the network and host portions directly.

What does /24 mean?

A /24 means 24 network bits and 8 host bits. That is 2^8, or 256 total addresses. Two of those are reserved: the network address itself and the broadcast address. So a /24 gives you 254 usable host addresses.

The math behind every prefix is three short formulas:

  • Host bits = 32 minus the prefix.
  • Total addresses = 2 raised to the host-bit count, or 2^(32 - prefix).
  • Usable addresses = total minus 2, because the network address and the broadcast address are not assignable to devices.

Apply that to /24. Host bits: 32 - 24 = 8. Total: 2^8 = 256. Usable: 256 - 2 = 254. Done. The same three lines work for any prefix you will ever meet.

The prefix also maps to a dotted subnet mask, which is the older way of writing the same information. A /24 is 255.255.255.0. Same split, different clothes. If the mask side is fuzzy, the companion piece on what is a subnet mask walks through that representation on its own terms.

Is a /24 bigger than a /26?

Yes. And this is the part that trips almost everyone up the first time.

A /24 holds 256 addresses. A /26 holds 64. The /24 is four times larger, even though 26 is the larger number. A bigger prefix number means a smaller network. The inversion is real and it is not a quirk, it falls straight out of the definition.

Here is why. The prefix counts network bits. Every bit you hand to the network side is a bit you take away from the host side. Fewer host bits means fewer possible host combinations. Going from /24 to /25 moves one bit across the line, which cuts the host space in half.

Watch the sequence:

  • /24 = 256 addresses
  • /25 = 128 addresses
  • /26 = 64 addresses
  • /27 = 32 addresses

Each step up halves the network. Each step down doubles it. Once you see it as a halving ladder, the inversion stops feeling backwards. You are not counting addresses with that number. You are counting how much of the address is locked down. Lock down more, and less is left to vary.

A quick sanity phrase that sticks: bigger slash, smaller network. Say it once and the confusion tends not to come back.

What are the common CIDR prefixes and their masks?

These are the prefixes you will actually type. Prefix, then dotted mask, then total addresses, then usable hosts:

  • /16 = 255.255.0.0 = 65,536 total = 65,534 usable
  • /24 = 255.255.255.0 = 256 total = 254 usable
  • /25 = 255.255.255.128 = 128 total = 126 usable
  • /26 = 255.255.255.192 = 64 total = 62 usable
  • /27 = 255.255.255.224 = 32 total = 30 usable
  • /28 = 255.255.255.240 = 16 total = 14 usable
  • /30 = 255.255.255.252 = 4 total = 2 usable

Notice the pattern in the mask column. As the prefix grows, the last non-zero octet climbs: 0, 128, 192, 224, 240, 252. Those values are not random. Each one is the previous one plus the next bit down, because you are filling in mask bits from the left. And notice the totals halving as you read down from /24 to /28.

The /30 row earns its keep. Four addresses, two usable, which is exactly enough for a router-to-router link with one address on each end. Nothing wasted.

For the full range in one place, the subnet mask cheat sheet lays out every prefix. For a specific network you are planning right now, the IP Subnet Calculator gives you the mask, range, and usable count in one shot.

Why did CIDR replace IP classes?

Because the old system wasted addresses on a scale that could not continue.

Before CIDR, IPv4 used a class-based scheme. Class A, Class B, Class C. Each class came with a fixed network size baked in: /8, /16, or /24, and nothing between. You did not choose your prefix. The leading bits of your address chose it for you.

The gaps were brutal. Suppose an organisation needed 400 addresses. A Class C at /24 gives 254 usable, not enough. The next size up was a Class B at /16, which gives 65,534 usable. So they got a /16. More than 65,000 addresses allocated, roughly 400 used, and the remaining 65,000-odd sat idle and unassignable to anyone else. Multiply that across thousands of organisations and the waste becomes the whole problem.

CIDR removed the classes and the fixed sizes with them. Any prefix length is legal. That organisation needing 400 addresses takes a /23, which covers them with modest headroom, and the rest of the space stays available. Networks get sized to what they actually need instead of to the nearest oversized bucket.

That is the historical reason CIDR exists: classful addressing locked you into /8, /16 and /24, and the mismatch between those three sizes and real-world requirements burned enormous numbers of addresses.

What about /31 and /32?

Two prefixes break the "minus 2" rule, and both are worth knowing.

/31 has 2 addresses, and on point-to-point links both are usable. Normally you would subtract the network and broadcast addresses and be left with zero, which would make a /31 useless. RFC 3021 defines the exception. On a link with exactly two endpoints, there is no need for a broadcast address, so both addresses go to the routers. That is why some engineers use /31 instead of /30 for point-to-point links: same job, half the space.

/32 is a single host address. All 32 bits are network bits, so nothing varies. You see /32 in routing tables, firewall rules, and loopback interfaces, anywhere you mean one exact address and no other.

Everything from /0 to /30 follows the standard formula. These two are the edge cases.

Bottom line

CIDR notation writes an address and its network size together. The slash number counts network bits out of 32. Subtract it from 32 to get host bits, raise 2 to that power for total addresses, subtract 2 for usable ones. And remember the inversion: a bigger prefix number is a smaller network, because each step up halves the space.

Learn the halving ladder from /24 down to /27 and most prefixes become readable on sight. For the rest, or when a network plan has to be right the first time, let the IP Subnet Calculator do the bit counting for you.

Related guides