Skip to content

CIDR Guide

Last updated: October 9, 2026

CIDR notation is an address, a slash, and a prefix length. In 192.168.1.0/24, the /24 means the first 24 bits stay fixed for every address in the block. The other 8 bits are free to name hosts. That single number replaced the old rule that a network had to be a class A, B, or C.

The same notation is what you paste into a route, a firewall rule, or a cloud subnet. Read it as a size, not as a host count. /24 is not 24 hosts. It is 24 network bits, and the block that follows from them holds 256 addresses.

What the slash counts

An IPv4 address is 32 bits, usually written as four decimal octets. CIDR makes the split between network and host explicit. The prefix length is how many leading bits are the network. RFC 4632 writes a prefix as the address, a slash, and a decimal from 0 to 32.

A longer prefix fixes more bits and names a smaller block. A shorter prefix leaves more host bits and names a larger block. /0 is the whole IPv4 space, one route for everything. /32 is a single address. Both are legal prefixes.

Two writings of the same block are common, and they are not always the network address. 10.1.2.3/16 does not mean the block is only 10.1.2.3. The /16 keeps the first two octets and clears the rest, so the network is 10.1.0.0 and the block runs through 10.1.255.255. The subnetting guide starts from that reading and then calculates a plan.

Move the prefix

Drag the boundary, or pick a prefix. Accent bits are the network. The bits after the line are the host. The mask, the network, and the usable range all come from that line.

Try a prefix

Prefix length

254 usable hosts

11000000101010000000000100110010
/24
/8/16/24/32
Network bitsHost bits

Drag the line, or use the arrow keys. The result updates as it moves.

CIDR block
192.168.1.0/24
Subnet mask
255.255.255.0
Wildcard
0.0.0.255
Network
192.168.1.0
Broadcast
192.168.1.255
Usable hosts
192.168.1.1 - 192.168.1.254
Addresses
256
Usable count
254
Host bits
8

192.168.1.50/24 names the same block as 192.168.1.0/24. The prefix clears the host bits.

24 network bits8 host bits
Address
11000000.10101000.00000001.00110010
Mask
11111111.11111111.11111111.00000000
Network
11000000.10101000.00000001.00000000

Open this block in the subnet calculator

From a prefix to a subnet mask

The subnet mask is the same boundary written as dotted decimal. Write that many 1 bits, then fill the rest with 0 bits, and convert each octet. /8 is 255.0.0.0. /16 is 255.255.0.0. /24 is 255.255.255.0. Those three land on an octet, which is why they are easy to see.

Prefixes between the octets need the last partial octet. /26 is 26 ones. The last octet starts with two 1 bits, which is 128 plus 64, so 192. The mask is 255.255.255.192. The remaining 6 host bits are a block of 64 addresses. The wildcard, the inverse used by a Cisco-style ACL, is 0.0.0.63: a 0 bit must match, and a 1 bit is ignored.

Only nine values can appear in a mask octet: 0, 128, 192, 224, 240, 248, 252, 254, and 255. Anything else, or a 1 bit that shows up after a 0, is not a prefix. Convert either direction in the subnet mask calculator, and the inverse in the wildcard mask calculator.

How many addresses a prefix holds

Total addresses are 2 to the power of the host bits. Host bits are 32 minus the prefix. /24 leaves 8, and 2 to the 8th is 256. Each time you lengthen the prefix by one, you cut that count in half.

For a conventional subnet, from /0 through /30, two of those addresses are not hosts. The all-zero host address is the network. The all-ones host address is the broadcast. Usable hosts are the total minus 2. A /27 has 32 addresses and 30 usable hosts. A /30 has 4 addresses and 2 usable hosts.

Stop subtracting 2 at the two shortest host fields. A /31 has two addresses, and RFC 3021 uses both on a point-to-point link, because that link has no need for a broadcast. A /32 is one address: a host route, a loopback, or a single firewall object. The full table, with those two rows handled on their own, is the CIDR reference.

A /24, read from 192.168.1.50

Start with the address you have, not with a hope that someone already typed the network. Clear the host bits to find the network. Set the host bits to find the broadcast.

192.168.1.50/24 clears the last octet, so the network is 192.168.1.0. The broadcast is 192.168.1.255. Usable hosts run from 192.168.1.1 through 192.168.1.254, which is 254 addresses. The mask is 255.255.255.0. The wildcard is 0.0.0.255.

The block size in the last octet is 256. A /24 steps through that octet once: .0 through .255. A shorter step, such as a /26, uses 256 minus the interesting mask octet. For 255.255.255.192 that step is 64, so the blocks in the last octet are .0, .64, .128, and .192.

Open the same block in the subnet calculator when you want the binary split beside a shareable result.

192.168.1.50/24
mask      255.255.255.0
network   192.168.1.0
broadcast 192.168.1.255
usable    192.168.1.1 - 192.168.1.254
wildcard  0.0.0.255

What classful sizes could not do

Before CIDR, the first bits of an address implied the mask. Class A was a /8, about 16 million addresses. Class B was a /16, 65,536 addresses. Class C was a /24, 256 addresses. You did not choose the size. The class chose it.

That wasted space. A site that needed 300 hosts could not fit in a /24, which has 254 usable hosts. The next class was a /16. CIDR lets the prefix fall where the requirement falls. 300 hosts fit in a /23, which has 510 usable hosts and mask 255.255.254.0.

The class letters still show up on old charts. They are labels, not the rule that sizes the block. A /24 happens to be the old class C size. The prefix is what matters. Private ranges such as 10.0.0.0/8 and 192.168.0.0/16 are ordinary prefixes too. They are special because of RFC 1918, not because of a class.

Combining blocks into one route

CIDR also runs in the other direction. Adjacent blocks that sit on a larger boundary can be advertised as one shorter prefix. 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, and 192.168.3.0/24 are four aligned blocks. Together they are exactly 192.168.0.0/22. A router can keep one route instead of four, and every address in that summary was already in the four blocks.

Alignment is the catch. 192.168.1.0/24 through 192.168.4.0/24 is also four blocks, and it is the same amount of space, but it does not start on a /22 boundary. The smallest single prefix that covers them is 192.168.0.0/21, and that cover includes 1,024 addresses none of the four blocks contained. A summary that looks shorter can permit traffic you did not mean to name.

Check a cover, and see the extra addresses called out, in the subnet merger. Splitting one block into equal children is the equal-split section of the subnetting guide.

The same slash in IPv6

IPv6 uses the same idea on a 128-bit address. The number after the slash is still how many leading bits are fixed. 2001:db8::/32 fixes 32 bits and leaves 96 host bits. The network, compressed, is 2001:db8::. A /64 is the usual LAN, because stateless address configuration expects it. A /48 or /56 is a typical delegation to a site. A /128 is one address.

Do not carry IPv4 habits across. IPv6 has no broadcast address, and the all-zero address inside a prefix is just the first address. There is no minus-two host count. Calculate a prefix in the IPv6 subnet calculator.

Prefixes you will actually type

These are the rows people look up. /31 and /32 do not use the minus-two host count. Every prefix from /0 to /32 is on the CIDR reference.

Common IPv4 prefixes with mask, size, and usable hosts
PrefixMaskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/23255.255.254.0512510
/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
/31255.255.255.25422 (both addresses)
/32255.255.255.25511 (the one address)

Questions

No. 192.168.1.50/24 names the same block as 192.168.1.0/24. The prefix clears the host bits, so the network is 192.168.1.0 either way.

A contiguous mask converts to exactly one prefix. 255.255.255.0 is /24, and /24 is 255.255.255.0. A mask whose 1 bits are broken up, such as 255.255.0.255, is not a prefix.

The first 24 bits are the network and the last 8 are host bits. The mask is 255.255.255.0. The block holds 256 addresses. For a normal subnet, 254 of them are usable hosts.

254. A /24 has 256 addresses. The first is the network address and the last is the broadcast, so usable hosts are 256 minus 2. That minus-two rule stops at /30. A /31 uses both addresses.

The number after the slash counts network bits, not hosts. Host bits are 32 minus the prefix. /24 leaves 8 host bits, and 2 to the 8th is 256 addresses.

A /30 has 4 addresses and 2 usable hosts, because the network and broadcast are held back. A /31 has 2 addresses, and RFC 3021 uses both of them on a point-to-point link. There is no broadcast to subtract.

Yes. They are the two aligned halves of 192.168.0.0/23. Two /24s that are adjacent but not aligned, such as 192.168.1.0/24 and 192.168.2.0/24, do not make a /23 without pulling in a block you did not list.

Yes. The prefix still counts leading bits, over 128 bits instead of 32. 2001:db8::/32 fixes 32 bits. IPv6 has no broadcast address, so this site does not subtract two hosts from an IPv6 prefix.

Those were fixed sizes: /8, /16, and /24. CIDR, defined for allocation in RFC 4632, lets the prefix sit on any bit from /0 to /32. A /24 is still a common LAN size. It is no longer a class.

The wildcard is the inverse of the subnet mask. Where the mask has a 0, the wildcard has a 1. In a Cisco-style ACL, a 0 bit must match and a 1 bit is ignored. The wildcard for /24 is 0.0.0.255.