IP Subnet Calculator (CIDR)

Quick answer

The subnet calculator gives the number of addresses and usable hosts in an IPv4 network from its CIDR prefix length, along with the subnet mask in dotted-decimal form.

Total addresses
—
Usable hosts
—
Mask octet 1
—
Mask octet 2
—
Mask octet 3
—
Mask octet 4
—

CIDR notation such as /24 tells you how many bits identify the network; the rest identify hosts.

How to use the IP Subnet Calculator

  1. Prefix length (/n)

Results update as you type, and every field accepts the units shown in its menu.

How it works

The host bits determine the number of addresses; the network and broadcast addresses are not usable for hosts.

Formula

Addresses = 2^(32 − prefix)Usable hosts = addresses − 2

Worked example

Inputs — Prefix length (/n): 24.
Results — Total addresses = 256; Usable hosts = 254; Mask octet 1 = 255; Mask octet 2 = 255; Mask octet 3 = 255; Mask octet 4 = 0.

Frequently asked questions

What mask is /24?

255.255.255.0, with 254 usable hosts.

Why subtract two?

The first address names the network and the last is the broadcast address.

What formula does the IP Subnet Calculator use?

Addresses = 2^(32 − prefix).

Cite this calculator

Speedy Calculator. (2026). IP Subnet Calculator (CIDR). Speedy Calculator. https://speedycalculator.com/calculators/other/subnet/