CIDR Notation Explained: Reading /24, /26 and /64

CIDR — Classless Inter-Domain Routing — is the modern way to write a network: an address, a slash, and a number, like 192.168.1.0/24 or 2001:db8::/48. That number, the prefix length, is the single most useful value in networking once you can read it on sight. This guide explains exactly what it means and how to size a network from it in your head.

The prefix counts network bits

An IPv4 address is 32 bits long. The prefix length says how many of those bits, counting from the left, are fixed as the network portion. In 192.168.1.0/24, the /24 means the first 24 bits are network and the remaining 8 are free for hosts. Those 24 network bits correspond to a mask of 255.255.255.0 — three full octets of ones followed by one octet of zeros.

Because the prefix is just "how many leading 1-bits are in the mask", every prefix maps to exactly one mask:

CIDRSubnet maskHost bitsTotal / usable (IPv4)
/24255.255.255.08256 / 254
/25255.255.255.1287128 / 126
/26255.255.255.192664 / 62
/27255.255.255.224532 / 30
/28255.255.255.240416 / 14
/30255.255.255.25224 / 2
/32255.255.255.25501 / 1 (single host)

Bigger prefix, smaller network

This trips people up at first: a larger prefix number means a smaller network. The reason is simple — more bits spent on the network means fewer bits left for hosts. Each extra bit on the prefix halves the address count. A /24 holds 256 addresses; a /25 holds 128; a /26 holds 64. Go the other way and a /23 holds 512. So when someone hands you a /27, you can immediately say "32 addresses, 30 usable" without a lookup.

The quick mental math

For any IPv4 prefix, the host-bit count is 32 − prefix, and the total addresses are 2 to that power. Then subtract 2 for the network and broadcast to get usable hosts. A /20? That is 12 host bits, 212 = 4096 addresses, 4094 usable. The same formula runs in reverse when you are sizing a network for a known number of hosts: need room for 500 devices? 29 = 512 covers it, so you need 9 host bits, which is a /23.

Don't want to do the powers of two by hand? Let the calculator expand any prefix instantly.

Open the Subnet Calculator

CIDR in IPv6

IPv6 uses the exact same slash-prefix syntax, only the address is 128 bits, so prefixes run from /0 to /128. The everyday sizes are larger and rounder: a /64 is the standard single subnet, a /56 or /48 is a whole site's allocation. There is no broadcast address and no "minus 2", so a /64 simply holds 264 addresses. Reading 2001:db8::/48 tells you the first 48 bits are fixed and there are 80 host bits to play with — enough for 65,536 separate /64 subnets.

Why CIDR replaced address classes

Before CIDR, IPv4 was carved into fixed classes — A (/8), B (/16) and C (/24). That was wasteful: an organisation needing 2,000 addresses had to take a whole class B of 65,536 or juggle hundreds of class Cs. CIDR removed the fixed boundaries so a network can be any prefix length, sized to actual need. That flexibility is what makes VLSM subnetting possible and why every modern network is described in CIDR. Start from what a subnet is if the network-versus-host split is still fuzzy.