Skip to content
RunStack
Subnet Calculator

IPv4/IPv6 Subnet Calculator

PrivacyAll calculations run in your browser. IP addresses and networks never leave the client.
Examples:

About the subnet calculator

What is CIDR

CIDR writes a network as address plus prefix length: 192.168.1.0/24. Bits after the slash are the network portion; the rest are host bits.

Subnet mask

Mask 255.255.255.0 equals /24: ones in the network part, zeros in the host part. Wildcard mask is the inverse (for ACLs).

Network and Broadcast

Network is the first address of the block. Broadcast is the last (IPv4 only). Hosts usually skip both, except /31 and /32.

/24, /25, /26… address counts

Total IPv4 addresses = 2^(32−prefix). Usable hosts are usually total−2. Do not mix total and usable counts.

/31 and /32

/31 (RFC 3021) is point-to-point with both addresses usable. /32 is a single host. The classic −2 rule does not apply.

IPv6 prefixes

IPv6 has no broadcast and no classic usable−2. /64 is common per segment. We show network, first/last, compressed and expanded forms.

VLSM

Variable Length Subnet Mask: place largest requirements first, then smaller ones, to reduce address waste.

Reference: IPv4 total addresses
PrefixTotal addresses
/24256
/25128
/2664
/2732
/2816
/298
/304
/312
/321

These are total addresses, not usable hosts.