IPv4 Subnet Cheatsheet

–network address, broadcast and usable hosts
CIDRNetmaskWildcardTotal addressesUsable hosts
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822
/3224.0.0.031.255.255.255536,870,912536,870,910
/4240.0.0.015.255.255.255268,435,456268,435,454
/5248.0.0.07.255.255.255134,217,728134,217,726
/6252.0.0.03.255.255.25567,108,86467,108,862
/7254.0.0.01.255.255.25533,554,43233,554,430
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011
The /1–/32 ladder is computed from the bit math in RFC 1878 (Variable Length Subnet Table for IPv4): the netmask is 32 minus prefix bits of zeros, the wildcard is its complement, and usable hosts = 2^(32−prefix) − 2 (network and broadcast reserved). /31 is the point-to-point exception (RFC 3021) with 2 usable addresses, and /32 is a single host route. Bottom line: /24 (255.255.255.0, 254 hosts) is the most common LAN size, /30 (4 addresses, 2 usable) is the classic point-to-point link, and the difference between /31 and /32 is the difference between a link and a loopback. Network siblings: HTTP status codes table, HTTP methods table, URL parser, MIME types table.

Subnetting is bit arithmetic: the CIDR prefix says how many bits are fixed, the rest are free. This cheatsheet lists all 32 prefixes with their netmask, wildcard, total addresses and usable hosts - computed from the bit math in RFC 1878, the canonical VLSM reference. The calculator takes any IP and prefix and returns the network address, broadcast and usable host count.

The two exceptions the table exposes: /31 has 2 usable addresses (point-to-point links per RFC 3021), and /32 is a single host route with none to spare.

How to use

  1. Enter an IP and pick a prefix; the network address, broadcast and usable hosts compute instantly.
  2. Scan the table for the standard sizes: /24 (254 hosts) for LANs, /30 (2 hosts) for links, /32 for single hosts.
  3. The wildcard column is what access-control lists and firewall rules use - the bit-flipped netmask.

Frequently asked questions

Why are 2 addresses subtracted from the usable count?

The first address in a subnet is the network identifier (never assigned to a host), and the last is the broadcast address (received by all hosts simultaneously). Together they consume 2 of the total, leaving total minus 2 for actual devices - except /31 point-to-point links and /32 single hosts, which the table marks separately.

What is the difference between a netmask and a wildcard?

They are bitwise complements: where the netmask has 1s (the network portion), the wildcard has 0s, and vice versa. Netmasks tell routers what to match; wildcards tell ACLs what to skip. The table shows both so you never have to flip bits by hand.

What does the /32 prefix mean?

A /32 is a single-host route: all 32 bits are fixed, there is exactly one address, no network or broadcast reservation. It is used for loopback interfaces, host routes in routing tables, and firewall rules that target one specific machine.

What is VLSM and why does it matter?

Variable Length Subnet Masking means different subnets within one organisation can use different prefix lengths - /24 for a LAN, /30 for a link, /27 for a DMZ. Before RFC 1878 popularised VLSM, networks used classful addressing that wasted millions of addresses; VLSM is why the IPv4 internet still functions.

Related tools