IP Subnet Calculator

Calculate subnet mask, network address, and host range.

Guides & Reference

How It Works

Usable hosts = 2^(32-prefix) - 2. Subtract 2 for network address and broadcast address which cannot be assigned to hosts.

Formula

Network = IP AND Mask

Quick Reference

Common calculations — results you can verify instantly.

/24 subnet

2^8-2

254 hosts

/16 subnet

2^16-2

65,534 hosts

/30 subnet

2^2-2

2 hosts (point-to-point)

Tips & Shortcuts

/24 = 254 hosts. /16 = 65534 hosts. /8 = 16.7M hosts.

CIDR /24 means 24 bits for network 8 bits for hosts.

Common Mistakes

Forgetting to subtract network and broadcast

Two addresses reserved: network (all 0s) and broadcast (all 1s).

Confusing prefix length with subnet mask

/24 = 255.255.255.0. /16 = 255.255.0.0. /8 = 255.0.0.0.

Frequently Asked Questions

2^(32-24)-2 = 254 usable hosts.

Classless Inter-Domain Routing. /prefix shows how many bits are network bits.

Related Calculators