Subnet Calculator

IPv4 network, broadcast, host range and mask from an IP and CIDR prefix.

The formula behind it

network = IP AND mask · broadcast = network OR wildcard
mask
32 bits: the /prefix 1-bits (network part) followed by 0-bits (host part)
wildcard
the inverse mask — the host-part bits
usable hosts
2^(32 − prefix) − 2, excluding the network and broadcast addresses

Every IPv4 address is 32 bits. The prefix length says how many leading bits are the network: AND-ing the address with the mask keeps those bits and zeros the rest, yielding the network address; OR-ing with the wildcard sets the host bits, yielding broadcast. Everything between is host space.

How to use this calculator

  1. 1

    Enter the IPv4 address you were given (e.g. 192.168.1.130).

  2. 2

    Enter the prefix length in CIDR form (e.g. 24, 26) — it's the /n after addresses and on router WAN pages.

  3. 3

    Press Calculate: the network and broadcast addresses, first/last usable host, usable count, mask and wildcard all come from the two bit operations.

  4. 4

    Use 'first usable' through 'last usable' for device address ranges; the network and broadcast addresses themselves are reserved.

  5. 5

    The steps show the arithmetic so you can verify by hand for exams or troubleshooting.

Worked examples

192.168.1.130/26

Mask 255.255.255.192 (26 one-bits). Network = 192.168.1.128, broadcast = 192.168.1.191, usable hosts 62 (192.168.1.129–.190). Block size 64 — the next /26 starts at 192.168.1.192.

10.0.0.77/30

Mask 255.255.255.252. Network 10.0.0.76, broadcast 10.0.0.79, exactly 2 usable hosts (.77 and .78) — the classic point-to-point WAN link sizing.

Frequently asked questions

Explore more categories

Command Palette

Search for a command to run...