Every IPv4 prefix length with its mask, the number of addresses in the block and how many can be given to devices.
How to read the table
A prefix length such as /24 says how many leading bits of an address name the network. The rest name the device. Each row shows the same block size written three ways: as a prefix, as a subnet mask, and as the count of addresses.
Addresses is the size of the block: 2 to the power (32 minus the prefix). Each step down the table halves it.
Usable hosts is two fewer, because the first address names the network and the last is the broadcast address. The exceptions are /31 (a link between two routers, both addresses usable) and /32 (one single address).
Wildcard mask is the mask inverted. Some firewall rules and routing settings ask for it.
If you came with a number of devices in mind, read up from the bottom and stop at the first row whose "usable hosts" is large enough, then go one row further if the network will grow. If you came with a mask, find it in the second column to learn its prefix. To see the actual range for an address, put it into the subnet calculator.
Prefix
Subnet mask
Wildcard mask
Addresses
Usable hosts
/0
0.0.0.0
255.255.255.255
4,294,967,296
4,294,967,294
/1
128.0.0.0
127.255.255.255
2,147,483,648
2,147,483,646
/2
192.0.0.0
63.255.255.255
1,073,741,824
1,073,741,822
/3
224.0.0.0
31.255.255.255
536,870,912
536,870,910
/4
240.0.0.0
15.255.255.255
268,435,456
268,435,454
/5
248.0.0.0
7.255.255.255
134,217,728
134,217,726
/6
252.0.0.0
3.255.255.255
67,108,864
67,108,862
/7
254.0.0.0
1.255.255.255
33,554,432
33,554,430
/8
255.0.0.0
0.255.255.255
16,777,216
16,777,214
/9
255.128.0.0
0.127.255.255
8,388,608
8,388,606
/10
255.192.0.0
0.63.255.255
4,194,304
4,194,302
/11
255.224.0.0
0.31.255.255
2,097,152
2,097,150
/12
255.240.0.0
0.15.255.255
1,048,576
1,048,574
/13
255.248.0.0
0.7.255.255
524,288
524,286
/14
255.252.0.0
0.3.255.255
262,144
262,142
/15
255.254.0.0
0.1.255.255
131,072
131,070
/16
255.255.0.0
0.0.255.255
65,536
65,534
/17
255.255.128.0
0.0.127.255
32,768
32,766
/18
255.255.192.0
0.0.63.255
16,384
16,382
/19
255.255.224.0
0.0.31.255
8,192
8,190
/20
255.255.240.0
0.0.15.255
4,096
4,094
/21
255.255.248.0
0.0.7.255
2,048
2,046
/22
255.255.252.0
0.0.3.255
1,024
1,022
/23
255.255.254.0
0.0.1.255
512
510
/24
255.255.255.0
0.0.0.255
256
254
/25
255.255.255.128
0.0.0.127
128
126
/26
255.255.255.192
0.0.0.63
64
62
/27
255.255.255.224
0.0.0.31
32
30
/28
255.255.255.240
0.0.0.15
16
14
/29
255.255.255.248
0.0.0.7
8
6
/30
255.255.255.252
0.0.0.3
4
2
/31
255.255.255.254
0.0.0.1
2
2
/32
255.255.255.255
0.0.0.0
1
1
The sizes you will actually meet
/32: one address. Used in firewall rules and routing to mean "exactly this device".
/30 and /31: the link between two routers.
/29 and /28: a small block of public addresses for a business, 6 or 14 usable.
/24: the standard home and small office network: 254 devices, mask 255.255.255.0.
/16: a large site or campus: 65,534 devices. The whole 192.168 private range is one /16.
/8: the whole 10.x.x.x private range, over 16 million addresses.
/0: every address there is. In a routing table 0.0.0.0/0 is the "default route", meaning "anything else goes this way".
Splitting and joining blocks
Because each prefix step halves the block, any block splits cleanly into two of the next size: one /24 becomes two /25s, four /26s, eight /27s and so on. The reverse also works when the blocks are neighbours on the right boundary: 192.168.0.0/24 and 192.168.1.0/24 join into 192.168.0.0/23. Networks of different sizes can share one larger block, as long as each starts on a boundary that suits its size. This is how an office divides one range between floors, guests and cameras, and it is the usual subject of subnetting questions in exams.
A quick way to find block boundaries
Subtract the last non-255 number of the mask from 256. The answer is the block size in that position. For 255.255.255.224 (a /27): 256 − 224 = 32, so networks start at 0, 32, 64, 96 and so on. For 255.255.240.0 (a /20): 256 − 240 = 16, so networks start at 0, 16, 32... in the third number. The idea behind this is in subnet masks and CIDR explained.
What does CIDR stand for?
Classless Inter-Domain Routing. It replaced the old fixed classes A, B and C in 1993 and lets a network be any power-of-two size.
Which prefix gives 100 hosts?
A /25 gives 126 usable addresses, the smallest block that fits 100.
Is a bigger prefix number a bigger network?
No, the opposite. A bigger number means more bits for the network and fewer for devices, so /30 is tiny and /8 is huge.