How Many Hosts Are in a /24?

A /24 subnet contains 256 total addresses, of which 254 are usable for hosts. The two reserved addresses are the network address (all host bits 0) and the broadcast address (all host bits 1). This page explains the math, the edge cases, and why the answer is not always 254.

Built by a network engineerCalculations run locally in your browserNo signup requiredNetwork information is not transmitted to our servers

The short answer

ValueCount
Total addresses256
Network address (reserved)1
Broadcast address (reserved)1
Usable hosts254

The math

A /24 leaves 8 bits for hosts (32 − 24 = 8). The total number of addresses is 2⁸ = 256. Two are reserved, so usable hosts = 256 − 2 = 254.

host bits  h = 32 - prefix = 32 - 24 = 8
total      = 2^h = 2^8 = 256
usable     = 2^h - 2 = 256 - 2 = 254

What the two reserved addresses are

For 192.168.1.0/24:

AddressRoleBinary (last octet)
192.168.1.0Network address00000000
192.168.1.1First usable host00000001
192.168.1.254Last usable host11111110
192.168.1.255Broadcast address11111111

Why subtract 2?

The all-zeros host address identifies the network itself (used in routing tables), and the all-ones host address is the directed broadcast — a packet sent to this address is delivered to every host in the subnet. Both are required by RFC 791 and cannot be assigned to an interface.

Edge cases where the answer changes

/31 — 2 usable, 0 reserved (RFC 3021)

On point-to-point links, RFC 3021 allows a /31 to use both addresses as host addresses, with no dedicated broadcast. A /31 gives 2 usable hosts with zero waste. See How /31 Networks Work.

/32 — 1 address, a single host

A /32 is a host route — one address, no network/broadcast overhead. Used for loopback addresses, firewall rules, and /32 host routes in BGP.

/31 and /32 comparison

PrefixTotalUsable hostsNotes
/3042Traditional point-to-point
/3122RFC 3021, no broadcast
/3211Single host route

Host counts for nearby prefixes

PrefixHost bitsTotalUsable hosts
/257128126
/2666462
/2753230
/2841614
/29386
/30242

Each time you borrow one more bit for the network, you halve the host count. For the full table, see the CIDR cheat sheet.

Practical: fitting 254 hosts on a /24

254 is the theoretical maximum. In practice you lose addresses to infrastructure:

  • Default gateway: 1
  • Switch management IPs: 1–2
  • DHCP relay / reserved leases: a handful
  • Printers, cameras, IoT: varies

A realistic access VLAN on a /24 supports ~240 endpoints. If you expect to exceed that, plan a /23 or split into two /24s. Use the VLAN sizing calculator to estimate.

Related guides

Technically Reviewed By

Senior Enterprise Network Engineer — 25+ years of IT and network infrastructure experience, including enterprise Cisco switching, routing, wireless, firewalls, VPN, network access control, SD-WAN, and large-scale network operations.

Last reviewed: 2026-09-02

Calculations are performed using standards-based formulas and verified against known reference values. All computation runs client-side in your browser.