Subnet cheat sheet

Every IPv4 prefix from /0 to /32 with its subnet mask, wildcard mask, total addresses, and usable host count. Click any prefix for a page with a live calculator, or grab the whole table from the free JSON API.

PrefixSubnet maskWildcardTotal addressesUsable hostsTypical use
/00.0.0.0255.255.255.2554,294,967,2964,294,967,294Very large network
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646Very large network
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822Very large network
/3224.0.0.031.255.255.255536,870,912536,870,910Very large network
/4240.0.0.015.255.255.255268,435,456268,435,454Very large network
/5248.0.0.07.255.255.255134,217,728134,217,726Very large network
/6252.0.0.03.255.255.25567,108,86467,108,862Very large network
/7254.0.0.01.255.255.25533,554,43233,554,430Very large network
/8255.0.0.00.255.255.25516,777,21616,777,214Very large network
/9255.128.0.00.127.255.2558,388,6088,388,606Large network
/10255.192.0.00.63.255.2554,194,3044,194,302Large network
/11255.224.0.00.31.255.2552,097,1522,097,150Large network
/12255.240.0.00.15.255.2551,048,5761,048,574Large network
/13255.248.0.00.7.255.255524,288524,286Large network
/14255.252.0.00.3.255.255262,144262,142Large network
/15255.254.0.00.1.255.255131,072131,070Large network
/16255.255.0.00.0.255.25565,53665,534Large network
/17255.255.128.00.0.127.25532,76832,766Standard LAN size
/18255.255.192.00.0.63.25516,38416,382Standard LAN size
/19255.255.224.00.0.31.2558,1928,190Standard LAN size
/20255.255.240.00.0.15.2554,0964,094Standard LAN size
/21255.255.248.00.0.7.2552,0482,046Standard LAN size
/22255.255.252.00.0.3.2551,0241,022Standard LAN size
/23255.255.254.00.0.1.255512510Standard LAN size
/24255.255.255.00.0.0.255256254Standard LAN size
/25255.255.255.1280.0.0.127128126Small subnet
/26255.255.255.1920.0.0.636462Small subnet
/27255.255.255.2240.0.0.313230Small subnet
/28255.255.255.2400.0.0.151614Small subnet
/29255.255.255.2480.0.0.786Small subnet
/30255.255.255.2520.0.0.342Point-to-point link (2 usable)
/31255.255.255.2540.0.0.122Point-to-point link (RFC 3021)
/32255.255.255.2550.0.0.011Single host route

How to read this table

Each row is one prefix length. Larger prefix numbers mean smaller networks: a /30 is tiny (4 addresses), a /8 is enormous (16.7 million). The subnet mask and wildcard mask columns are two views of the same boundary, and the usable host count is the total minus the network and broadcast addresses, with /31 and /32 handled as special cases.

The prefixes people look up most are /24 (the default LAN), /30 and /31 (point-to-point links), and /26 through /29 (small segments). Each has its own page with a calculator, worked example, and FAQ. For the concepts behind the numbers, read what is CIDR, what is a subnet mask, or classful vs classless addressing. Working from a host count instead of a prefix? See subnet by host count.

Frequently asked questions

What is a CIDR cheat sheet?

A CIDR cheat sheet is a quick-reference table that maps every prefix length to its subnet mask, wildcard mask, and host count. This one covers /0 through /32.

What is the subnet mask for each CIDR prefix?

The table below lists all of them. To pick a few: /24 is 255.255.255.0, /26 is 255.255.255.192, /30 is 255.255.255.252, and /16 is 255.255.0.0.

How do I know how many hosts a prefix allows?

Take 2 to the power of the host bits, then subtract 2 for the network and broadcast addresses. A /24 has 8 host bits, so 256 minus 2 = 254 usable hosts.

Which prefix should I use for a point-to-point link?

A /30 gives two usable hosts, the classic choice. A /31 gives two usable addresses with no waste under RFC 3021, and is preferred where the hardware supports it.