A "/24 gives 254 usable hosts" is the textbook subnetting answer. Inside an AWS VPC it's wrong by 3 — AWS reserves 5 addresses per subnet, not the 2 (network + broadcast) that standard subnetting math accounts for. Here's the exact count for every common VPC subnet size.
Standard IPv4 subnetting reserves two addresses per subnet: the network address (all host bits 0) and the broadcast address (all host bits 1). AWS reserves three more on top of that, per AWS's VPC sizing documentation:
That's 5 total, so a subnet's AWS-usable count is 2^(32 − prefix) − 5 instead of the standard 2^(32 − prefix) − 2.
| CIDR | Total addresses | Standard usable | AWS VPC usable | GCP VPC usable |
|---|---|---|---|---|
| /16 | 65,536 | 65,534 | 65,531 | 65,533 |
| /17 | 32,768 | 32,766 | 32,763 | 32,765 |
| /18 | 16,384 | 16,382 | 16,379 | 16,381 |
| /19 | 8,192 | 8,190 | 8,187 | 8,189 |
| /20 | 4,096 | 4,094 | 4,091 | 4,093 |
| /21 | 2,048 | 2,046 | 2,043 | 2,045 |
| /22 | 1,024 | 1,022 | 1,019 | 1,021 |
| /23 | 512 | 510 | 507 | 509 |
| /24 | 256 | 254 | 251 | 253 |
| /25 | 128 | 126 | 123 | 125 |
| /26 | 64 | 62 | 59 | 61 |
| /27 | 32 | 30 | 27 | 29 |
| /28 | 16 | 14 | 11 | 13 |
Range shown is /16 to /28 — AWS's allowed VPC subnet size range. GCP reserves 3 addresses (network, a second address, and broadcast) per GCP's VPC subnet documentation, so its usable count sits between the standard and AWS figures.