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.

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.

Official sources

Related calculators

Continue reading