The subnet cheat sheet

Every IPv4 prefix from /32 to /0 — mask, wildcard, address count, usable hosts, and how big it is next to a /24. Plus the IPv6 prefixes that come up in a real allocation. Print it, or take the PDF.

IPv4 subnet cheat sheet

Every prefix from /32 to /0 with its mask, wildcard, address count and how it sizes against a /24. Nothing to click — the table is the page.

IPv4 prefixes, /32 to /0
CIDRSubnet maskWildcardAddressesUsable hostsAgainst a /24Typically
/32255.255.255.2550.0.0.0111/256 of a /24Single host route
/31255.255.255.2540.0.0.1221/128 of a /24Point-to-point link — both addresses usable (RFC 3021)
/30255.255.255.2520.0.0.3421/64 of a /24Smallest classic subnet: 2 hosts
/29255.255.255.2480.0.0.7861/32 of a /246 hosts — small point-to-multipoint
/28255.255.255.2400.0.0.1516141/16 of a /2414 hosts
/27255.255.255.2240.0.0.313230⅛ of a /2430 hosts — typical small office VLAN
/26255.255.255.1920.0.0.636462¼ of a /2462 hosts
/25255.255.255.1280.0.0.127128126½ of a /24126 hosts — half a /24
/24255.255.255.00.0.0.2552562541 × /24The default LAN: 254 hosts
/23255.255.254.00.0.1.2555125102 × /24Two /24s joined
/22255.255.252.00.0.3.2551,0241,0224 × /24Common VLAN allocation: 1,022 hosts
/21255.255.248.00.0.7.2552,0482,0468 × /24
/20255.255.240.00.0.15.2554,0964,09416 × /24Site allocation: 4,094 hosts
/19255.255.224.00.0.31.2558,1928,19032 × /24
/18255.255.192.00.0.63.25516,38416,38264 × /24
/17255.255.128.00.0.127.25532,76832,766128 × /24
/16255.255.0.00.0.255.25565,53665,534256 × /24Whole private range 192.168.0.0/16; former class B
/15255.254.0.00.1.255.255131,072131,070512 × /24
/14255.252.0.00.3.255.255262,144262,1421,024 × /24
/13255.248.0.00.7.255.255524,288524,2862,048 × /24
/12255.240.0.00.15.255.2551,048,5761,048,5744,096 × /24Private range 172.16.0.0/12
/11255.224.0.00.31.255.2552,097,1522,097,1508,192 × /24
/10255.192.0.00.63.255.2554,194,3044,194,30216,384 × /24Carrier-grade NAT 100.64.0.0/10
/9255.128.0.00.127.255.2558,388,6088,388,60632,768 × /24
/8255.0.0.00.255.255.25516,777,21616,777,21465,536 × /24Private range 10.0.0.0/8; former class A
/7254.0.0.01.255.255.25533,554,43233,554,430131,072 × /24
/6252.0.0.03.255.255.25567,108,86467,108,862262,144 × /24
/5248.0.0.07.255.255.255134,217,728134,217,726524,288 × /24
/4240.0.0.015.255.255.255268,435,456268,435,4541,048,576 × /24
/3224.0.0.031.255.255.255536,870,912536,870,9102,097,152 × /24
/2192.0.0.063.255.255.2551,073,741,8241,073,741,8224,194,304 × /24
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,6468,388,608 × /24
/00.0.0.0255.255.255.2554,294,967,2964,294,967,29416,777,216 × /24Every address — the default route

IPv6 prefixes

IPv6 has no broadcast address and no reason to count hosts — a /64 holds more addresses than the whole IPv4 internet, several billion times over. What matters is how many /64 LANs a prefix gives you.

Common IPv6 prefixes
CIDRAddresses/64 LANsTypically
/1281Single address — a host route or a loopback
/1272^1Point-to-point link between routers
/1262^2Older point-to-point convention
/1202^8Rare; the same host count as an IPv4 /24
/1122^16Sometimes used for infrastructure links
/962^32IPv4-mapped address space
/642^641 × /64The standard LAN. SLAAC requires exactly this
/602^6816 × /6416 LANs — a very small site
/562^72256 × /64Typical residential or small-branch allocation
/522^764,096 × /64Mid-size site
/482^8065,536 × /64Typical enterprise site allocation
/442^841,048,576 × /64Large enterprise
/402^8816,777,216 × /64Large enterprise or small ISP
/362^92268,435,456 × /64ISP allocation
/322^964,294,967,296 × /64Minimum allocation an RIR hands an ISP

Everyone memorises the /24 row and then re-derives the rest at three in the morning. That is the entire reason this page exists — not to teach subnetting, but to sit open in a tab while you work.

We sell asset-tracking software, so read the pitch above with a raised eyebrow. The table costs nothing and asks nothing.

Reading a row

Take /26. The mask is 255.255.255.192, the wildcard is 0.0.0.63, and the block holds 64 addresses of which 62 can go on interfaces. Four of these fit inside a /24. That last column is the one worth internalising: network people size things in /24s the way builders think in metres, and "a /26 is a quarter of a /24" gets you further in a planning meeting than 255.255.255.192 ever will.

The wildcard column is not decoration. Cisco ACLs and OSPF network statements take the mask inverted, and inverting it by hand under time pressure is where the typos come from.

The two rows most charts get wrong

A /31 shows two usable hosts here, not zero. RFC 3021 made both addresses on a /31 assignable specifically so router-to-router links stop burning four addresses to carry a two-address conversation, and it has been standard since 2000. Plenty of published cheat sheets still print 0, because they were generated by subtracting network and broadcast from every row without thinking about it.

A /32 is a single host route — one address, one usable. It shows up in routing tables, loopback interfaces and firewall rules constantly, and "0 usable hosts" is equally wrong there.

About the IPv6 half

Counting hosts in IPv6 is a category error. A /64 holds 18.4 quintillion addresses; whether 40 or 4,000 devices sit on it changes nothing you would plan around. So that table counts /64s instead, because the actual question is how many LANs your allocation gives you — a /56 gives 256, a /48 gives 65,536, and if your ISP handed you a single /64 for a site with more than one VLAN, that is the conversation to have with them.

One caveat worth stating plainly: SLAAC needs exactly a /64. Subnet an IPv6 LAN tighter than that to "save space" and stateless autoconfiguration stops working, and you have saved space in a protocol where space is the one thing nobody is short of.

Need the arithmetic done for a specific address rather than a table to read? The subnet calculator takes an address and a mask and works it out, splits a block into subnets, and checks a pasted IP plan for overlaps.

Subnetting — quick answers

  • Is there a PDF version?

    Yes — the Download PDF button generates one with the full IPv4 table as selectable text, not a screenshot. There is a CSV too if you would rather paste the rows into a spreadsheet, and the Print button gives you a clean page without the site chrome.

    Why does /27 give 30 hosts and not 32?

    A /27 block holds 32 addresses, but the first is the network address and the last is the broadcast address, so 30 are left for interfaces. Every row from /30 up to /0 works the same way. The exceptions are /31 and /32.

    What is the difference between a subnet mask and a wildcard mask?

    They are inverses of each other. 255.255.255.0 as a mask is 0.0.0.255 as a wildcard. Interfaces and routing tables want the mask; Cisco access lists and OSPF network statements want the wildcard, which is why both columns are here.

Tracking the devices behind those subnets? Talk to sales

up arrow