Practical guide

How many IP addresses are in a /24?

A /24 contains 256 IPv4 addresses and usually 254 conventional host addresses. See the calculation, range, and /31 and /32 exceptions.

By StackCalcs · Updated

A /24 IPv4 network contains 256 total addresses because it leaves eight host bits: 2^(32 − 24) = 256. In a conventional subnet, 254 addresses are available to hosts after reserving the network and broadcast addresses.

Worked example

For 10.20.30.0/24, the range is 10.20.30.0 through 10.20.30.255. The conventional usable host range is 10.20.30.1 through 10.20.30.254.

Prefix Total addresses Conventional usable addresses
/22 1,024 1,022
/23 512 510
/24 256 254
/25 128 126
/26 64 62
/27 32 30
/28 16 14
/29 8 6
/30 4 2
/31 2 2 on an RFC 3021 point-to-point link
/32 1 1 host route

Enter any address and prefix in the CIDR calculator, or read the full CIDR subnetting guide for the mask and bitwise method.

Why “254 usable” isn’t always right

The 254-usable-host figure assumes a conventional subnet where the first address is reserved for the network and the last for broadcast. Two cases break that assumption:

Common questions

How many usable IPs does a /24 have in AWS or Google Cloud?

The block still contains 256 addresses, but cloud reservations change the assignable count:

Subnet context Reserved addresses Assignable addresses before allocations
Conventional IPv4 subnet 2 254
Standard AWS VPC subnet 5 251
Google Cloud primary IPv4 subnet range 4 252

AWS reserves the first four and final addresses in a standard subnet. Google Cloud reserves the first two and final two in a primary range; its secondary ranges have different rules. These counts describe capacity before resources consume addresses, not the number currently free. Check provider-specific exceptions such as AWS BYOIP before applying the standard rule.

For example, if a standard AWS /24 already has 190 assigned addresses, the remaining address budget is 251 − 190 = 61, not 254 − 190 = 64. Allow extra capacity for deployments that temporarily run old and new instances together.

General /24 questions

Does a /24 always mean a “Class C” network? No — classful addressing (Class A/B/C) was replaced by CIDR in 1993 (RFC 4632). A /24 is just a prefix length; it can appear anywhere in the address space, not only in what used to be Class C ranges.

Is 10.20.30.0 always the network address? Only if the prefix makes it one — i.e., if the host bits are all zero for the given prefix. The same address with a /16 prefix would put it inside a much larger block where it is not the network address.

How do I find the /24 that contains a given address? Zero out the last octet: for any address a.b.c.d/24, the network address is a.b.c.0. The CIDR calculator does this for any prefix, not just /24.

Official sources

Related calculators

Continue reading