Subnet Mask & CIDR Cheat Sheet

By Paul Snyman · Published · 6 min read

Every subnet mask and CIDR prefix from /8 to /30, with the total address count and usable host count for each, in one table. Bookmark this page if you configure networks often enough to need it but not often enough to have it memorized.

The Cheat Sheet

CIDRSubnet MaskTotal AddressesUsable Hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

/24 (255.255.255.0) is the default for most home routers. /30 is the standard for a point-to-point link between two devices, since 2 usable hosts is exactly enough for both ends.

How to Read CIDR Notation

The number after the slash is how many bits, counted from the left, are fixed as the network portion of the address. The remaining bits identify individual hosts within that network. 192.168.1.0/24 means the first 24 bits (192.168.1) are fixed, and the last 8 bits are free to assign to devices, addresses 192.168.1.0 through 192.168.1.255.

Fewer host bits means fewer usable addresses but a more contained broadcast domain. More host bits means more addresses but more devices sharing the same broadcast traffic. That trade-off is the entire reason subnetting exists, splitting a large network into smaller ones to control broadcast scope and simplify routing.

Network Address, Broadcast Address, and the Usable Range

Every subnet reserves exactly two addresses that can't be assigned to a device:

Everything in between is usable: 192.168.1.1 through 192.168.1.254 for a /24. That's where the "usable hosts = total addresses minus 2" rule comes from, and why the formula is 2^(host bits) - 2.

The one exception: /31 subnets (2 total addresses) don't reserve a network or broadcast address, per RFC 3021, both addresses are usable for a point-to-point link. /32 is a single host with no subnet at all, used for routing to one specific address.

How to Calculate a Subnet by Hand

Worked example: you're given 10.0.4.0/22 and need to know the range and host count.

  1. Find the host bits. /22 leaves 32 - 22 = 10 host bits.
  2. Total addresses. 2^10 = 1,024.
  3. Usable hosts. 1,024 - 2 = 1,022.
  4. Block size. With 10 host bits, the third octet steps in increments of 4 (256 / 2^6 network bits in that octet = 4). So the range runs 10.0.4.0 to 10.0.7.255.
  5. Network address: 10.0.4.0. Broadcast address: 10.0.7.255. Usable range: 10.0.4.1 to 10.0.7.254.

That block-size step (the increment between subnet boundaries in the octet where the mask stops being all-1s or all-0s) is the part most people get wrong doing this by hand, and it's exactly the kind of arithmetic worth handing to a calculator instead.

Common Subnet Mistakes

Assigning the network or broadcast address to a device

Set a device's static IP to the network or broadcast address and it simply won't communicate, with no obviously helpful error. This is the single most common static-IP mistake, and it's why checking the usable range before assigning anything matters.

Overlapping DHCP scopes across VLANs

If two subnets on the same physical network are sized wrong and their ranges overlap, you get duplicate-IP conflicts that are miserable to trace. Confirming each subnet's exact range before configuring DHCP scopes avoids this entirely.

Undersizing a subnet you'll grow into

A /28 (14 usable hosts) feels like plenty for a small office until you add a few IoT devices, a couple of access points, and a printer. Size for headroom, going from /28 to /27 costs nothing and doubles your usable addresses.

Calculate Any Subnet Instantly on iPhone

  1. Open PingKit's Subnet Calculator.
  2. Enter an IP address with a CIDR prefix (like 192.168.1.0/24) or a dotted-decimal subnet mask.
  3. PingKit instantly shows the network address, broadcast address, usable host range, total and usable host counts, and the mask in both CIDR and dotted-decimal notation.

It converts in both directions, so you can enter a CIDR prefix and get the mask, or enter a mask and get the CIDR prefix, without doing the binary conversion yourself.

Frequently Asked Questions

What does /24 mean?

/24 is CIDR for a 255.255.255.0 subnet mask: 256 total addresses, 254 usable hosts. It's the default subnet size for most home routers and small networks.

How do I convert a subnet mask to CIDR notation?

Count the consecutive 1 bits in the mask. 255.255.255.0 has 24 ones, so it's /24. 255.255.255.192 has 26 ones, so it's /26. PingKit's Subnet Calculator converts either direction instantly.

How many usable hosts does a subnet have?

2^(host bits) - 2. A /24 has 8 host bits: 2^8 - 2 = 254. A /30 has 2 host bits: 2^2 - 2 = 2, the standard size for a link between exactly two devices.

What's the difference between the network address and the broadcast address?

The network address (first in the range) identifies the subnet and can't be assigned to a device. The broadcast address (last in the range) reaches every device on the subnet at once and also can't be assigned. Everything between the two is usable.

Is PingKit's Subnet Calculator free?

Yes. The Subnet Calculator and all 19 tools are free, with no ads and no account required.

Calculate Any Subnet in Seconds

PingKit's Subnet Calculator handles the CIDR math for you, alongside 18 more free network tools.

Download PingKit Free

Related Articles