Network · Developer

How many hosts in a /24?

A /24 contains 256 addresses and 254 usable hosts: the first address is the network address and the last is the broadcast address. Try any other prefix below, or enter how many hosts you need to find the smallest subnet that fits.

Advertisement

Inputs

Result

Enter a prefix or a host count.

Why a /24 has 254 hosts, not 256

A /24 leaves 8 bits for hosts, so 28 = 256 addresses. The all-zeros host address (for example 192.168.1.0) names the network itself and the all-ones host address (192.168.1.255) is the broadcast address, so 256 − 2 = 254 usable hosts, from .1 to .254. The same rule gives /25 = 126, /26 = 62, /27 = 30, /28 = 14, /29 = 6 and /30 = 2.

The rule changes at the small end. RFC 3021 lets a /31 use both of its two addresses as hosts on a point-to-point link, and a /32 is a single address. To plan several differently sized subnets at once, use the VLSM calculator; for a specific address, use the subnet calculator.

Sources (retrieved 2026-10): RFC 4632 (classless inter-domain routing (CIDR)); RFC 3021 (31-bit prefixes on IPv4 point-to-point links); RFC 1878 (variable length subnet table for IPv4).

Frequently asked questions

How many IP addresses are in a /24?

256 addresses (2 to the power of 8). 254 of them can be assigned to hosts.

How many hosts are in a /23, /22, /21 and /20?

/23 has 510 usable hosts, /22 has 1,022, /21 has 2,046 and /20 has 4,094.

Why subtract 2?

The lowest address in a subnet identifies the network and the highest is the broadcast address, so neither is assigned to a host in the classic scheme.

Does a /31 or /32 follow the same rule?

No. A /31 gives 2 usable addresses on point-to-point links (RFC 3021) and a /32 is one address.

Pure arithmetic — no network access

This tool performs standard IPv4 subnet arithmetic entirely in your browser. It does not look anything up, and it doesn't check whether an address or subnet is actually routed, reachable, or assigned to anyone.

Advertisement
Advertisement