~/tools / subnet-calculator
// networking

IPv4 Subnet Calculator

Type an address with a prefix (10.20.30.40/26) or a dotted netmask (192.168.1.10 255.255.255.0). Results update as you type.

● runs 100% in your browser — nothing is uploaded

Result

Binary

How subnetting works

An IPv4 address is 32 bits. The prefix length (the number after the slash) says how many of those bits identify the network; the remaining bits identify hosts inside it. A /26 keeps 26 network bits and leaves 6 host bits, so the block holds 26 = 64 addresses.

The first address of the block is the network address and the last is the broadcast address; neither can be assigned to a host, which is why a /26 has 62 usable hosts. The two exceptions are /31 (point-to-point links, RFC 3021: both addresses usable) and /32 (a single host route).

Wildcard mask

The wildcard mask is the bitwise inverse of the netmask (255.255.255.192 → 0.0.0.63). Cisco IOS ACLs and OSPF network statements use it instead of the netmask.

Quick reference

  • /24 — 255.255.255.0 — 254 hosts
  • /25 — 255.255.255.128 — 126 hosts
  • /26 — 255.255.255.192 — 62 hosts
  • /27 — 255.255.255.224 — 30 hosts
  • /28 — 255.255.255.240 — 14 hosts
  • /29 — 255.255.255.248 — 6 hosts
  • /30 — 255.255.255.252 — 2 hosts