Home / Other Calculators / Subnet Calculator

Utilities

Subnet Calculator

Enter an IPv4 address and CIDR prefix to get the network and broadcast addresses, subnet mask, wildcard mask, usable host range, and host count.

Network address

192.168.1.0

Broadcast
Subnet mask
Host range
Usable hosts

How it works

An IPv4 address is 32 bits. The CIDR prefix says how many leading bits are the network portion; the rest address hosts. Applying the mask with a bitwise AND gives the network address, and setting all host bits gives the broadcast address.

mask = 0xFFFFFFFF shifted left by (32 − prefix)
network = IP AND mask
broadcast = network OR (NOT mask)
usable hosts = 2^(32 − prefix) − 2

Common prefixes

CIDRMaskUsable hosts
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/30255.255.255.2522

Frequently asked questions

What is CIDR notation?

An IP followed by a slash and prefix length, like 192.168.1.0/24 — the prefix is the number of network bits.

Why are two addresses unusable?

The first is the network ID and the last is the broadcast address, so a /24 has 254 usable hosts, not 256.

Related calculators