Home › Everyday Life › IP Subnet Calculator

IP Subnet Calculator

This IP subnet calculator takes an IPv4 address and prefix length and gives the network, broadcast, mask and usable host range.

How subnetting works

The prefix length says how many leading bits are the network part. The rest identify hosts.

Usable hosts = 2(32 − prefix) − 2

The first address is the network address and the last is the broadcast address, so neither can be given to a device. The exceptions are /31 (two-address point-to-point links, RFC 3021) and /32 (a single host).

Example

192.168.1.10/24 has mask 255.255.255.0. Network: 192.168.1.0, broadcast: 192.168.1.255, usable hosts 192.168.1.1–192.168.1.254 (254 hosts).

CIDR cheat sheet

PrefixSubnet maskUsable hosts
/8255.0.0.016,777,214
/16255.255.0.065,534
/20255.255.240.04,094
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522

Tips

  • Private ranges: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
  • Each step down in prefix doubles the addresses.
  • Converting values by hand? The data size converter helps with bits and bytes.

Frequently asked questions

How many hosts are in a /24?

254 usable hosts (256 addresses minus the network and broadcast addresses).

What is a wildcard mask?

The inverse of the subnet mask, used in router access lists. For 255.255.255.0 it is 0.0.0.255.

Does this support IPv6?

Not yet; it works with IPv4 addresses only.

Written and checked by Vijay. Last updated .