Ecosystem: Netrouting· DFDC· LayerSwitch
Registered broker · ARIN · RIPE NCC · APNIC +1 (305) 209-5007
Home/IP tools/Subnet cheat sheet
[ Reference · No sign-up ]

IPv4 subnet cheat sheet

Every prefix length from /0 to /32, with its subnet mask, wildcard mask, total addresses and usable hosts. The whole table is in the page, so it is searchable, copyable and prints on one sheet.

IPv4 prefix lengths with subnet mask, wildcard mask, address count and usable hosts
CIDR Subnet mask Wildcard Addresses Usable hosts Class equivalent
/0 0.0.0.0 255.255.255.255 4,294,967,296 4,294,967,294 256 × Class A
/1 128.0.0.0 127.255.255.255 2,147,483,648 2,147,483,646 128 × Class A
/2 192.0.0.0 63.255.255.255 1,073,741,824 1,073,741,822 64 × Class A
/3 224.0.0.0 31.255.255.255 536,870,912 536,870,910 32 × Class A
/4 240.0.0.0 15.255.255.255 268,435,456 268,435,454 16 × Class A
/5 248.0.0.0 7.255.255.255 134,217,728 134,217,726 8 × Class A
/6 252.0.0.0 3.255.255.255 67,108,864 67,108,862 4 × Class A
/7 254.0.0.0 1.255.255.255 33,554,432 33,554,430 2 × Class A
/8 255.0.0.0 0.255.255.255 16,777,216 16,777,214 1 × Class A
/9 255.128.0.0 0.127.255.255 8,388,608 8,388,606 128 × Class B
/10 255.192.0.0 0.63.255.255 4,194,304 4,194,302 64 × Class B
/11 255.224.0.0 0.31.255.255 2,097,152 2,097,150 32 × Class B
/12 255.240.0.0 0.15.255.255 1,048,576 1,048,574 16 × Class B
/13 255.248.0.0 0.7.255.255 524,288 524,286 8 × Class B
/14 255.252.0.0 0.3.255.255 262,144 262,142 4 × Class B
/15 255.254.0.0 0.1.255.255 131,072 131,070 2 × Class B
/16 255.255.0.0 0.0.255.255 65,536 65,534 1 × Class B
/17 255.255.128.0 0.0.127.255 32,768 32,766 128 × Class C
/18 255.255.192.0 0.0.63.255 16,384 16,382 64 × Class C
/19 255.255.224.0 0.0.31.255 8,192 8,190 32 × Class C
/20 255.255.240.0 0.0.15.255 4,096 4,094 16 × Class C
/21 255.255.248.0 0.0.7.255 2,048 2,046 8 × Class C
/22 255.255.252.0 0.0.3.255 1,024 1,022 4 × Class C
/23 255.255.254.0 0.0.1.255 512 510 2 × Class C
/24 255.255.255.0 0.0.0.255 256 254 1 × Class C
/25 255.255.255.128 0.0.0.127 128 126 1/2 × Class C
/26 255.255.255.192 0.0.0.63 64 62 1/4 × Class C
/27 255.255.255.224 0.0.0.31 32 30 1/8 × Class C
/28 255.255.255.240 0.0.0.15 16 14 1/16 × Class C
/29 255.255.255.248 0.0.0.7 8 6 1/32 × Class C
/30 255.255.255.252 0.0.0.3 4 2 1/64 × Class C
/31 255.255.255.254 0.0.0.1 2 2 RFC 3021 1/128 × Class C
/32 255.255.255.255 0.0.0.0 1 1 single host single host
Why /21 and /22 are the sizes buyers ask for. A /21 is 2,048 addresses and a /22 is 1,024. Both are large enough to be worth the registry paperwork, and small enough that most networks can justify the need. Below a /24 the space cannot be announced globally at all, because most operators filter anything longer. See what each size costs →

How to read the table

The CIDR figure counts the bits that identify the network. A /24 fixes the first 24 bits and leaves 8 for hosts, which is why it holds 256 addresses. Every step up the table doubles the block: a /23 is two /24s, a /22 is four.

The subnet mask is the same information written the older way, as four octets. The wildcard mask is that inverted, which is the form access lists on most routing platforms expect. It causes a lot of configuration mistakes, because the two look similar and mean the opposite.

Why usable hosts is two fewer than the address count

The first address in a block names the network itself and the last is the broadcast address, so neither can be assigned to a machine. A /24 holds 256 addresses and numbers 254 hosts.

Two prefixes break that rule, and both appear in real configurations. A /31 has no room for a network and broadcast address, so RFC 3021 defines both of its addresses as usable, which is the standard way to number a point-to-point link. A /32 is a single address with no network to broadcast to, which is how loopbacks and single-host routes are written.

Class A, B and C

Classful addressing was replaced by CIDR in 1993, but the vocabulary outlived it. Registries, brokers and buyers still say "a Class C" when they mean a /24. The last column translates, because the terms are still what people negotiate in, not because the classes still exist.

Common questions

How many IP addresses are in a /24?

256 addresses, of which 254 can be assigned to hosts.

What is the subnet mask for a /22?

255.255.252.0, covering 1,024 addresses and 1,022 usable hosts.

What is the smallest block that can be routed on the internet?

A /24. Longer prefixes are filtered by most networks, so a /25 or smaller can be used inside your own network but cannot be announced globally on its own.