# IPv4 CIDR Subnetting Cheat Sheet: /24, /25, /26 and Usable Hosts

> Calculate network addresses, broadcast addresses, wildcard masks, and usable IPv4 host counts for VPC design and firewall ACL rules.

- URL: https://proit.tools/guides/ipv4-subnet-cidr-notation-and-subnet-masks-explained
- Author: Mohammed Zawwar Hussain
- Published: 2026-12-01
- Updated: 2026-12-01
- Publisher: ProIT (proit.tools)

## How CIDR prefix lengths split 32-bit IPv4 addresses cleanly

Every IPv4 address consists of **32 binary bits** grouped for human convenience into four 8-bit decimal octets separated by dots (for example `192.168.10.0`). Classless Inter-Domain Routing (**CIDR**) appends a clean slash suffix (such as `/24` or `/26`) telling routers exactly how many leading bits form the fixed **network prefix** versus how many trailing bits remain free for individual **host addresses**.

        Host Bits = 32 − CIDR Prefix
Total IP Addresses in Block = 2^(Host Bits)
Standard Usable Host IPs = 2^(Host Bits) − 2 (reserving Network ID & Broadcast IP)
        Planning cloud VPC networks on AWS, Azure, GCP, or Oracle Cloud Infrastructure requires getting subnet boundaries exact from day one—overlapping CIDR blocks or under-sized `/28` database subnets block peering later and force messy instance migrations.

## Essential IPv4 CIDR subnet cheat sheet (/20 through /32)

| CIDR Prefix | Subnet Mask | Total IPs | Standard Usable Hosts | Common Infrastructure Role |

| `/16` | 255.255.0.0 | 65,536 | 65,534 | Master cloud VPC root address block (e.g. `10.0.0.0/16`) |

| `/20` | 255.255.240.0 | 4,096 | 4,094 | Large Kubernetes pod/cluster subnet |

| `/24` | 255.255.255.0 | 256 | 254 | Standard office LAN or regional VPC availability-zone tier |

| `/25` | 255.255.255.128 | 128 | 126 | Halving one /24 cleanly into two isolated 128-IP subnets (.0 and .128) |

| `/26` | 255.255.255.192 | 64 | 62 | Quartering a /24 across DMZ, app, database, and management tiers |

| `/28` | 255.255.255.240 | 16 | 14 | Tight bastion or managed NAT/load-balancer subnet |

| `/30` | 255.255.255.252 | 4 | 2 | Point-to-point router or BGP VPN tunnel link |

| `/32` | 255.255.255.255 | 1 | 1 (Single host) | Exact firewall allowlist entry (your office VPN IP) |

## Three-step subnetting check before allocating firewalls or cloud VPCs

- **Verify boundary alignment cleanly:** A valid `/26` block MUST start on a multiple of 64 (`.0`, `.64`, `.128`, or `.192`). Writing `10.0.1.30/26` actually maps down to network `10.0.1.0/26` (covering `.0–.63`), surprising engineers expecting `.30–.93`! Enter any IP/prefix into [Subnet & CIDR Calculator](https://proit.tools/tool/subnet-cidr-calculator) to view exact network boundary, broadcast address, first/last usable host, and binary mask immediately.

- **Account for cloud vendor reserved IPs:** While textbook RFC networks reserve 2 addresses (network ID and broadcast), cloud platforms like AWS VPC reserve **5 addresses** in every subnet (`.0` network, `.1` VPC router, `.2` DNS resolver, `.3` future reserved, and broadcast), leaving `64 − 5 = 59` usable instance IPs inside a `/26`!

- **Keep RFC 1918 private blocks strictly separated across VPNs:** When connecting multiple offices or clouds over WireGuard/IPsec, carve distinct non-overlapping slices (e.g. `10.10.0.0/16` HQ vs `10.20.0.0/16` Oracle Cloud) rather than defaulting everything to `192.168.1.0/24`. Inspect binary octet transitions via [Number Base Converter](https://proit.tools/tool/number-base-converter) or verify public egress IP ranges with [IP Address & Geolocation Inspector](https://proit.tools/tool/ip-geolocation-lookup).

## Understanding wildcard masks and firewall ACL syntax

Cisco IOS ACLs, OSPF router configurations, and several firewall rule syntaxes request a **wildcard mask** (inverse subnet mask) instead of a dotted subnet mask. Finding wildcard masks takes simple subtraction from `255.255.255.255`: a `/24` mask (`255.255.255.0`) flips cleanly to wildcard `0.0.0.255`, while a `/26` mask (`255.255.255.192`) flips to `0.0.0.63`. [Subnet & CIDR Calculator](https://proit.tools/tool/subnet-cidr-calculator) computes wildcard masks, host totals, and binary bit splits locally right in your browser without sending internal architecture plans over the network.

## Worked multi-tier VPC design example from a single /22 parent block

Suppose an infrastructure engineer receives a clean `10.40.0.0/22` cloud VCN/VPC parent allocation (1,024 total IPs spanning `10.40.0.0` through `10.40.3.255`) to deploy public load balancers, private application containers, managed PostgreSQL instances, and Site-to-Site VPN gateways across two availability zones. Carve subnets sequentially along clean power-of-two boundaries so route tables summarize cleanly: allocate `10.40.0.0/25` (128 IPs) to Public ALB Tier A and `10.40.0.128/25` to Public ALB Tier B; place Private App containers inside `10.40.1.0/24` (256 IPs) and `10.40.2.0/24`; and reserve `10.40.3.0/26` alongside `10.40.3.64/26` for isolated database nodes, leaving `10.40.3.128/25` open for future Kubernetes worker pools—all double-checked conflict-free inside [Subnet & CIDR Calculator](https://proit.tools/tool/subnet-cidr-calculator) before applying cloud network scripts.

## Related tools

- [Subnet & CIDR Calculator](https://proit.tools/tool/subnet-cidr-calculator): Calculate host ranges, masks, and broadcast IPs locally
- [IP Address Lookup](https://proit.tools/tool/ip-geolocation-lookup): Inspect public IP ASN and location metadata
- [Number Base Converter](https://proit.tools/tool/number-base-converter): Convert IPv4 octets between binary and decimal cleanly

## Frequently asked questions

### Why do usable hosts equal total IPs minus 2 on standard LANs?

The lowest address identifies the network prefix itself and the highest address serves as the subnet broadcast IP, leaving 2^(host bits) − 2 assignable device addresses.

### How many usable hosts does a /24 vs /26 subnet hold?

A /24 subnet provides 254 standard usable hosts (256 total), while a /26 subnet provides 62 standard usable hosts (64 total).

### When should I write /32 in cloud security groups or nginx allow rules?

Use /32 whenever locking SSH, admin panels, or firewall rules down to one single static IPv4 address.

### What is special about /31 subnets on router links?

RFC 3021 lets routers use both addresses inside a /31 point-to-point link without wasting a network/broadcast address, conserving IPv4 space.

### What happens if an AWS or Oracle Cloud subnet runs out of private IPs later?

Active cloud subnets cannot shrink or expand their CIDR mask in place; you must allocate a fresh secondary non-overlapping subnet and migrate running workloads over, making accurate upfront capacity sizing and headroom planning in Subnet & CIDR Calculator crucial.

