Account

What new tool do you want?

Developer Tools

IP Subnet Calculator (CIDR)

Calculate network address, broadcast, subnet mask, wildcard, usable host range and host count for any IPv4 address and CIDR prefix.

How to use

  1. 1Enter an IP address with a prefix, e.g. 192.168.1.10/24, or pick the prefix separately.
  2. 2Read the network range, mask and number of usable hosts.

How it's calculated

Network = IP AND mask; broadcast = network OR wildcard. Usable hosts = 2^(32 − prefix) − 2, except /31 (2 hosts, RFC 3021) and /32 (1 host).

Frequently asked questions

How many hosts are in a /24?

256 addresses, of which 254 are usable — the first is the network address and the last is the broadcast.

What is a wildcard mask?

The inverse of the subnet mask (0.0.0.255 for /24). Cisco ACLs and OSPF use it to match address ranges.

Which ranges are private?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918). They're not routed on the public internet.

Worked example: IP Subnet Calculator

192.168.1.10/24 resolves to network 192.168.1.0/24, broadcast 192.168.1.255, subnet mask 255.255.255.0, and a usable host range of 192.168.1.1-192.168.1.254 — 254 usable addresses out of 256 total, because the first address (network) and last (broadcast) are both reserved. Change only the prefix to /13 with 10.20.30.40, and the network snaps to 10.16.0.0/13 (not 10.20.0.0) with 524,286 usable hosts — the /13 prefix leaves 19 bits for host addresses (2^19 - 2 = 524,286), and the network address itself always rounds the input IP down to the nearest boundary that prefix allows, which is why 10.20.x.x lands in the 10.16.0.0 block rather than starting exactly where you typed.

Why /31 and /32 break the normal 'subtract 2' rule

The usual formula — usable hosts = 2^(32-prefix) - 2 — reserves one address for the network and one for broadcast, which makes sense for any normal subnet but would leave a /31 (2 total addresses) with zero usable hosts at all. RFC 3021 specifically carves out an exception for /31 point-to-point links (like a direct connection between two routers), treating both addresses as usable since there's no need for a broadcast address when only two devices exist on the link. A /32 is a single host route, not a subnet at all, so it gets exactly 1 usable address — itself.

Why the historic class (A/B/C) column is there but rarely relevant

The classful system (Class A = /8, Class B = /16, Class C = /24) was how IP address space was allocated before 1993, when networks were assigned based purely on the first octet's value rather than an explicit prefix length — it's shown here because plenty of tooling and documentation still references "Class C" informally to mean a /24. Modern networking uses CIDR (Classless Inter-Domain Routing) exclusively, where any prefix from /0 to /32 is valid regardless of the address's leading bits, which is why this calculator lets you pick any arbitrary prefix rather than snapping to the old class boundaries — the class column is a historical reference, not a constraint on what prefixes are actually usable.

A slash in the address ignores the prefix menu

The address box opens on 192.168.1.10/24. When that text already contains a slash, the prefix menu is ignored, which the hint under the menu says. The prefix has to be a whole number from 0 to 32. Usable addresses are 1 on a /32 and 2 on a /31. Every wider prefix uses the block size minus 2. The first usable address is the network address itself on /31 and /32, and one past the network on every other prefix. I leave the menu alone when the address already names its prefix.

Related tools

More: Developer Tools