Subnet Calculator

Enter an IP address and CIDR prefix or subnet mask

Network address
-
Broadcast address
-
Host range
-
Usable hosts
-
Subnet mask
-
Wildcard mask
-
Binary representation
IP-
Mask-
Network-
Broadcast-

Subnet mask cheat sheet

CIDR Mask Hosts Typical use
/32 255.255.255.255 1 Single host
/30 255.255.255.252 2 Point-to-point link
/28 255.255.255.240 14 Small office
/24 255.255.255.0 254 Standard LAN
/20 255.255.240.0 4094 Large office / cloud VPC
/16 255.255.0.0 65534 Class B network
/8 255.0.0.0 16M+ Class A network

CIDR notation

CIDR (Classless Inter-Domain Routing) replaced the old class-based system in 1993. Instead of being stuck with /8, /16, or /24 boundaries, you can allocate any prefix length from /0 to /32.

The number after the slash is how many bits are the network portion. 192.168.1.0/24 means the first 24 bits identify the network, leaving 8 bits for hosts. That gives you 28 - 2 = 254 usable addresses (minus network and broadcast).

For /31 and /32, the rules are different. /31 subnets (RFC 3021) have 2 addresses with no broadcast - used for point-to-point links. /32 is a single host route.

Private IP ranges (RFC 1918)

Range CIDR Addresses Common use
10.0.0.0 - 10.255.255.255 10.0.0.0/8 16.7M Cloud VPCs, large corporate networks
172.16.0.0 - 172.31.255.255 172.16.0.0/12 1M Docker default, medium networks
192.168.0.0 - 192.168.255.255 192.168.0.0/16 65K Home networks, small offices

Also worth knowing: 169.254.0.0/16 is link-local (APIPA), 127.0.0.0/8 is loopback, and 100.64.0.0/10 is carrier-grade NAT (RFC 6598). These aren't routable on the public internet.

Choosing the right subnet size

Leave room to grow. If you have 20 hosts, don't use a /27 (30 usable). Use a /26 (62 usable) or /25 (126). Renumbering a network is painful.

Cloud providers reserve addresses. AWS reserves 5 IPs per subnet (network, router, DNS, future, broadcast). A /28 that should have 14 hosts only gives you 11 on AWS.

Separate concerns with subnets. Put web servers, databases, and management on different subnets. It's easier to apply security groups and ACLs at the subnet level than per host.

Document everything. IP allocation gets messy fast. Track which subnets are assigned where, or you'll end up with overlapping ranges when you peer VPCs or set up VPN tunnels.

Monitor servers across all your subnets from a single dashboard

Start monitoring with fivenines.io