All tools run in your browser — your files never leave your device.
All tools154

Developer & Security

Subnet Calculator

CIDR to mask, host range, broadcast and usable count.

What it does. CIDR notation writes a network as an address and a prefix length — <code>192.168.1.0/24</code> means the first 24 bits identify the network and the remaining 8 identify hosts. A /24 therefore holds 256 addresses, of which 254 are usable: the first is the network address and the last is the broadcast address.
Runs in your browserNothing uploadsNo signupWorks offline

How to use Subnet Calculator

  1. Enter an address with a CIDR prefix, or an address and a netmask.
  2. Read the network, broadcast, first and last host, and usable count.
  3. Optionally split the block into equal subnets.

Reading the prefix

Reading the prefix
CIDRNetmaskAddressesUsable
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/24255.255.255.0256254
/22255.255.252.01,0241,022
/16255.255.0.065,53665,534

Usable is always two fewer than the total on IPv4: the all-zeros host is the network address and the all-ones host is the broadcast. The exception is /31, which RFC 3021 defines as a two-address point-to-point link with no broadcast, and /32, a single host.

Why the smaller number is the bigger network

The prefix counts network bits, so a smaller prefix leaves more bits for hosts. A /16 is 256 times larger than a /24, which reads backwards until you think in bits.

Each step down doubles the size: /25 is 128 addresses, /24 is 256, /23 is 512.

A practical consequence is that networks must align to their own size. A /24 can start at .0 or 10.0.1.0 but not at 10.0.0.128 — the network address must have zeros in all host bits, so blocks sit on boundaries that are multiples of their size.

Private ranges

Three IPv4 ranges are reserved for private use and are never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.

The 172.16 range is the one people get wrong. It is a /12, so it spans 172.16.0.0 to 172.31.255.255 — not 172.16 to 172.16.255.255, and not all of 172.

Also worth knowing: 169.254.0.0/16 is link-local, which is what a machine assigns itself when DHCP fails. An address in that range is a symptom, not a configuration.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 contains 256 addresses; the first is the network address and the last is the broadcast, so neither can be assigned to a host.

Why is a /16 bigger than a /24?

The prefix counts network bits, so a smaller prefix leaves more bits for hosts. A /16 leaves 16 host bits — 65,536 addresses — against a /24’s 8 bits and 256.

What is a /31 for?

Point-to-point links. RFC 3021 allows both addresses in a /31 to be used, because a two-endpoint link has no need for a broadcast address. It saves two addresses per link across a large network.

What is the private range for 172?

172.16.0.0/12, which spans 172.16.0.0 to 172.31.255.255. It is not all of 172, and not only 172.16 — this is the most commonly misremembered of the three private ranges.

Why did my device get a 169.254 address?

That is link-local, self-assigned when DHCP fails to answer. It indicates the device could not reach a DHCP server, so the fix is on the network rather than the device.