IP Subnet Cheat Sheet

Every IPv4 prefix from /32 to /8 with its subnet mask, wildcard mask, total addresses and usable hosts. For example, a /24 is 255.255.255.0 (wildcard 0.0.0.255) with 256 addresses and 254 usable hosts.

Updated

IPv4 Subnetting Chart

CIDRSubnet MaskWildcardAddressesUsable Hosts
/32255.255.255.2550.0.0.0111
/31255.255.255.2540.0.0.1222
/30255.255.255.2520.0.0.342
/29255.255.255.2480.0.0.786
/28255.255.255.2400.0.0.151614
/27255.255.255.2240.0.0.313230
/26255.255.255.1920.0.0.636462
/25255.255.255.1280.0.0.127128126
/24255.255.255.00.0.0.255256254
/23255.255.254.00.0.1.255512510
/22255.255.252.00.0.3.2551,0241,022
/21255.255.248.00.0.7.2552,0482,046
/20255.255.240.00.0.15.2554,0964,094
/19255.255.224.00.0.31.2558,1928,190
/18255.255.192.00.0.63.25516,38416,382
/17255.255.128.00.0.127.25532,76832,766
/16255.255.0.00.0.255.25565,53665,534
/15255.254.0.00.1.255.255131,072131,070
/14255.252.0.00.3.255.255262,144262,142
/13255.248.0.00.7.255.255524,288524,286
/12255.240.0.00.15.255.2551,048,5761,048,574
/11255.224.0.00.31.255.2552,097,1522,097,150
/10255.192.0.00.63.255.2554,194,3044,194,302
/9255.128.0.00.127.255.2558,388,6088,388,606
/8255.0.0.00.255.255.25516,777,21616,777,214
1 A /32 is a single host address (host route or loopback).
2 A /31 uses both addresses on point-to-point links (RFC 3021).

IPv6 Subnet Chart

Number of subnets created per given prefix.

Prefix/48/56/64/127Total Addresses
/2416M4G1T8,388,608Y16,777,216Y
/258M2G512G4,194,304Y8,388,608Y
/264M1G256G2,097,152Y4,194,304Y
/272M512M128G1,048,576Y2,097,152Y
/281M256M64G524,288Y1,048,576Y
/29512K128M32G262,144Y524,288Y
/30256K64M16G131,072Y262,144Y
/31128K32M8G65,536Y131,072Y
/3264K16M4G32,768Y65,536Y
/3332K8M2G16,384Y32,768Y
/3416K4M1G8,192Y16,384Y
/358K2M512M4,096Y8,192Y
/364K1M256M2,048Y4,096Y
/372K512K128M1,024Y2,048Y
/381K256K64M512Y1,024Y
/39512128K32M256Y512Y
/4025664K16M128Y256Y
/4112832K8M64Y128Y
/426416K4M32Y64Y
/43328K2M16Y32Y
/44164K1M8Y16Y
/4582K512K4Y8Y
/4641K256K2Y4Y
/472512128K1Y2Y
/48125664K512Z1Y
/49-12832K256Z512Z
/50-6416K128Z256Z
/51-328K64Z128Z
/52-164K32Z64Z
/53-82K16Z32Z
/54-41K8Z16Z
/55-25124Z8Z
/56-12562Z4Z
/57--1281Z2Z
/58--64512E1Z
/59--32256E512E
/60--16128E256E
/61--864E128E
/62--432E64E
/63--216E32E
/64--18E16E

Units: Y = 1,208,925,819,614,629,174,706,176; Z = 1,180,591,620,717,411,303,424; E = 1,152,921,504,606,846,976; T = 1,099,511,627,776; G = 1,073,741,824; M = 1,048,576; K = 1,024

Subnetting quick answers

How many usable hosts are in a subnet?

Usable hosts = 2(32 − prefix) − 2, because the network and broadcast addresses are reserved. A /26 has 64 addresses and 62 usable hosts. A /31 is the exception: both of its addresses are usable on point-to-point links.

What is a wildcard mask?

A wildcard mask is the inverse of the subnet mask: subtract each octet from 255. The wildcard for 255.255.255.224 (/27) is 0.0.0.31. Cisco ACLs and OSPF use wildcard masks.

How do I convert a subnet mask to CIDR?

Count the 1 bits in the mask. 255.255.255.192 is 24 + 2 = 26 ones, so it is a /26. See RFC 4632 for CIDR notation.

Which IPv6 prefix should a network use?

Use a /64 for each LAN, as SLAAC requires (RFC 4291). Sites typically receive a /48 or /56, which give 65,536 or 256 /64 subnets.

Need a specific network? Use the subnet calculator or read how to subnet.