CIDR notation

CIDR notation: The slash-prefix shorthand (e.g. /24) that states how many leading bits of an IP address are the fixed network portion. A smaller number after the slash means a larger network with more usable addresses.

CIDR notation: quantity example

The selected private IPv4 block is an example allocation, not a guarantee that an address is available on an existing network. That leaves 2⁸ = 256 addresses. Two are reserved, the network address and the broadcast address, so 254 can be assigned to devices; the matching mask is 255.255.255.0.

Slice it smaller: /26 leaves 6 host bits, so 64 addresses and 62 usable, with a mask of 255.255.255.192; a /27 gives 32 addresses and 30 usable. A /16 gives 65,536. Each extra bit in the prefix cuts the number of addresses in half.

A common misunderstanding

Confusing a smaller prefix number with a smaller network. A /16 is far larger than a /24: the relationship between the prefix number and the network size runs backward from what the digit alone suggests.

Related measurements

CIDR notation and the subnet mask describe the same thing in two forms. The slash form counts the network bits. The dotted mask writes them out as four numbers. /24 and 255.255.255.0 are identical.

CIDR replaced the older class system, where addresses were fixed at Class A, B or C sizes, so a network could be any prefix length; it is also different from an IP address itself; the address names a device. The prefix says how much of the address belongs to the network it sits on.

Limits of the definition

The prefix tells you the size of a block and nothing about who owns it or whether it is safe. Reserved addresses reduce the usable count in most subnets, and some cloud providers reserve a few more. IPv6 uses the same notation but with far larger blocks, and its habits differ, since a /64 is the standard subnet size.

Overlapping blocks cause routing problems. Plan ranges on paper first, leave gaps for growth and document them, because changing a network's size later is disruptive.

Understanding CIDR notation

The number after the slash sets a tradeoff, not just a label: a smaller number describes a larger block with more addresses but less room to split into separate subnets, while a larger number carves smaller, more numerous subnets out of the same space. Reading the prefix correctly is the first step in any subnetting decision.

Using CIDR notation

Network engineers write CIDR blocks when planning address space, configuring routers and setting firewall rules. Cloud consoles ask for it when you create a virtual network or a security group; a rule that allows 10.0.0.0/8 admits sixteen million addresses, while a /32 admits exactly one. Internet providers use it to summarize routes.

Anyone splitting an office network into departments works out how many devices each segment needs and picks the smallest prefix that fits with room to grow.

CIDR notation: follow the example through

Assumed example: The address 192.168.1.0/24 says the first 24 of 32 bits identify the network and the last 8 identify hosts. That leaves 2⁸ = 256 addresses. Two are reserved, the network address and the broadcast address, so 254 can be assigned to devices; the matching mask is 255.255.255.0.

Slice it smaller: /26 leaves 6 host bits, so 64 addresses and 62 usable, with a mask of 255.255.255.192; a /27 gives 32 addresses and 30 usable. A /16 gives 65,536. Each extra bit in the prefix cuts the number of addresses in half.

CIDR notation: calculation reference

Network = IP AND subnet mask; broadcast = network OR wildcard mask; usable hosts = 2^(32−prefix) − 2 (RFC 4632 CIDR)

CIDR notation: stated assumptions for the linked calculation, rather than observed personal or market figures.
QuantityEntered or calculated amountMeaning
CIDR prefix length24The number after the slash, e.g. the 24 in 192.168.1.0/24. 0-32.
IP address, first octet192Explicit example input.
IP address, second octet168Explicit example input.
IP address, third octet1Explicit example input.
IP address, fourth octet0Explicit example input.
Usable host addresses254Result under the listed assumptions.
Network address192.168.1.0Result under the listed assumptions.
Broadcast address192.168.1.255Result under the listed assumptions.

Subnet Calculator: change the inputs and compare the resulting cases

Confirm the prefix describes the block you think it does by computing the actual address range, rather than assuming from the number alone.

Related concepts