Report

Help us improve this tool

Hosts Per Subnet Calculator

Find usable host counts from IPv4 prefix length or subnet mask, including /31 and /32 edge cases.

O M T

How many hosts fit in an IPv4 subnet?

DHCP scopes, firewall objects, and cloud security groups all depend on how many addresses a prefix provides. Enter either a CIDR prefix length (such as /26) or a dotted subnet mask to see total addresses, usable hosts, and the matching mask and wildcard values.

How to use this calculator

  1. Choose whether you are typing a prefix (24) or a mask (255.255.255.0).
  2. Enter the value and read the usable host count card.
  3. Copy the JSON breakdown for runbooks or exam notes.

For full network and broadcast addresses from CIDR, pair this with the IPv4 IPv6 Subnet Calculator or the CIDR Calculator.

Frequently Asked Questions

Why do /31 and /32 behave differently?

Modern point-to-point links often use /31 (RFC 3021) with two usable addresses. A /32 identifies a single host, so usable hosts equals one.

Can I paste non-contiguous masks?

No. The mask must be a contiguous run of one bits followed by zeros (for example 255.255.255.128). Invalid masks return an error.

Does this tool handle IPv6?

This page focuses on IPv4 host math. Use the IPv4 IPv6 Subnet Calculator for IPv6 prefix planning.