IP Subnet Calculator

Calculate network address, broadcast, mask and usable host range from CIDR.

What the IP Subnet Calculator does

A CIDR prefix says how many leading bits identify the network. Everything after those bits addresses hosts inside it, so the prefix length alone determines the subnet mask, the block size and how many hosts the subnet can hold.

Formula

  • Subnet mask = 32 bits with the first /n set
  • Network = IP AND Mask
  • Broadcast = Network OR Wildcard
  • Usable hosts = 2^(32 − n) − 2

Inputs explained

InputUnitRequiredNotes
IPv4 addresstextYes
CIDR prefix lengthnumberYesThe number after the slash, from 0 to 32. Accepts 0 or more, up to 32.

How to use it

  1. Enter IPv4 address and CIDR prefix length.
  2. Select Calculate.

Worked example

The address 192.168.1.100 with a /24 prefix.

Address
192.168.1.100
CIDR
24

Mask 255.255.255.0, network 192.168.1.0, broadcast 192.168.1.255. Hosts run .1 to .254 — 254 usable out of 256.

Frequently asked questions

Why does a /24 have 254 usable hosts and not 256?

The all-zeros address identifies the network and the all-ones address is the broadcast. Neither can be assigned to a host.

What is a wildcard mask?

The bitwise inverse of the subnet mask. A /24 mask of 255.255.255.0 has a wildcard of 0.0.0.255, which is the form Cisco ACLs and OSPF use.

Related calculators