Free tool · Reference

Subnet Cheat Sheet

The /0–/32 reference: mask, wildcard, hosts and block size.

CIDRSubnet maskWildcardUsable hostsTotal
/00.0.0.0255.255.255.2554,294,967,2944,294,967,296
/1128.0.0.0127.255.255.2552,147,483,6462,147,483,648
/2192.0.0.063.255.255.2551,073,741,8221,073,741,824
/3224.0.0.031.255.255.255536,870,910536,870,912
/4240.0.0.015.255.255.255268,435,454268,435,456
/5248.0.0.07.255.255.255134,217,726134,217,728
/6252.0.0.03.255.255.25567,108,86267,108,864
/7254.0.0.01.255.255.25533,554,43033,554,432
/8255.0.0.00.255.255.25516,777,21416,777,216
/9255.128.0.00.127.255.2558,388,6068,388,608
/10255.192.0.00.63.255.2554,194,3024,194,304
/11255.224.0.00.31.255.2552,097,1502,097,152
/12255.240.0.00.15.255.2551,048,5741,048,576
/13255.248.0.00.7.255.255524,286524,288
/14255.252.0.00.3.255.255262,142262,144
/15255.254.0.00.1.255.255131,070131,072
/16255.255.0.00.0.255.25565,53465,536
/17255.255.128.00.0.127.25532,76632,768
/18255.255.192.00.0.63.25516,38216,384
/19255.255.224.00.0.31.2558,1908,192
/20255.255.240.00.0.15.2554,0944,096
/21255.255.248.00.0.7.2552,0462,048
/22255.255.252.00.0.3.2551,0221,024
/23255.255.254.00.0.1.255510512
/24255.255.255.00.0.0.255254256
/25255.255.255.1280.0.0.127126128
/26255.255.255.1920.0.0.636264
/27255.255.255.2240.0.0.313032
/28255.255.255.2400.0.0.151416
/29255.255.255.2480.0.0.768
/30255.255.255.2520.0.0.324
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

About this tool

Free IPv4 subnet cheat sheet. A complete /0 to /32 reference table of CIDR prefix, subnet mask, wildcard mask, usable hosts, total addresses and block size — printable and searchable. Everything runs entirely in your browser — nothing you type is sent to a server.

Guide by the Elematron team · Last reviewed

Every prefix length from /0 to /32 maps to one subnet mask, one wildcard mask and a fixed number of addresses. Engineers who subnet quickly have the last octet memorised; everyone else keeps a table like this one nearby. Use the search to jump to a prefix, or print the page.

How to use the Subnet Cheat Sheet

  1. Search for a prefix (/27), a mask (255.255.255.224) or a host count.
  2. Read across the row: mask, wildcard, total addresses, usable hosts and block size.
  3. Use the block size to find valid network addresses: they are multiples of it in the relevant octet.

The rows you will use most

/24  255.255.255.0    0.0.0.255   256 addresses  254 hosts
/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 (point-to-point, RFC 3021)
/32  255.255.255.255  0.0.0.0       1              1 (host route)

The pattern repeats in each octet: /16 to /23 follow the same masks in the third octet, and /8 to /15 in the second.

How the table is built

Each row follows from one number, the prefix length n. The mask has n ones followed by 32 - n zeros. The total number of addresses is 2^(32 - n). The wildcard mask is the mask's bits inverted.

Because masks fill bits from the left, the only values that ever appear in a mask octet are 0, 128, 192, 224, 240, 248, 252, 254 and 255. Learning those nine values, and that each one halves the block size of the one before, is most of what you need to subnet in your head.

Reading the results

Block size
256 minus the interesting octet of the mask. Networks start at multiples of it.
Usable hosts
2^(32 - prefix) minus 2, except /31 and /32.
Wildcard
255 minus each mask octet.

Common mistakes

  • Forgetting to subtract the network and broadcast addresses.
  • Assuming a /23 spans x.x.1.0 to x.x.2.255. A /23 must start on an even third octet, for example x.x.2.0 to x.x.3.255.

Frequently asked questions

How many hosts are in a /28?

14 usable out of 16 addresses.

What is the mask for /22?

255.255.252.0, covering four /24s.

How do I memorise the masks?

Learn the bit values 128, 64, 32, 16, 8, 4, 2, 1 and add them up: 128+64+32 = 224 for three bits, which is /27 in the last octet.

Further reading

Related tools