Subnet Calculator

Enter an IPv4 address and CIDR prefix to instantly calculate the network address, broadcast, subnet mask, wildcard mask, usable hosts, and more.

IPv4 Subnet Calculator

Subnet Details

  • Network Address
  • Broadcast Address
  • Subnet Mask
  • Wildcard Mask
  • Total Addresses
  • Usable Hosts
  • First Usable IP
  • Last Usable IP
  • CIDR Notation

Understanding CIDR Notation

CIDR (Classless Inter-Domain Routing) notation expresses an IP address and its subnet mask together, like 192.168.1.0/24. The number after the slash is the prefix length — how many bits are fixed in the network portion.

Network bits + Host bits = 32 (for IPv4) Usable hosts = 2^(host bits) − 2 Total addresses = 2^(host bits)

Common Subnet Sizes

The most frequently used prefixes are /8 (Class A, 16 million hosts), /16 (Class B, 65,534 hosts), /24 (Class C, 254 hosts), and /30 (point-to-point, 2 hosts). For VLSM (Variable Length Subnet Masking), any prefix from /0 to /32 is valid.

Private IP Address Ranges (RFC 1918)

These ranges are reserved for private use and are not routable on the public internet:

  • 10.0.0.0/8 — Class A private, 16,777,216 addresses. Common in large enterprise networks.
  • 172.16.0.0/12 — Class B private range (172.16.0.0 – 172.31.255.255). Often used in medium-sized networks.
  • 192.168.0.0/16 — Class C private, the most common range for home and small office networks.
  • 169.254.0.0/16 — Link-local (APIPA). Assigned automatically when DHCP fails.

Practical Examples

Example 1: A home network on 192.168.1.0/24

Network: 192.168.1.0 | Mask: 255.255.255.0 | Broadcast: 192.168.1.255
Usable: 192.168.1.1 – 192.168.1.254 (254 hosts)

Example 2: A point-to-point link on 10.0.0.0/30

Network: 10.0.0.0 | Broadcast: 10.0.0.3
Usable: 10.0.0.1 – 10.0.0.2 (2 hosts — one per end of the link)

Example 3: An enterprise /22 block giving 1,022 hosts

10.10.4.0/22 → Hosts: 10.10.4.1 – 10.10.7.254 (1,022 usable)

Planning Gateways and DHCP

  • The gateway (default router) is typically the first or last usable host in the subnet.
  • Reserve a small static range at the start of the subnet for infrastructure (switches, APs, printers).
  • DHCP pools should avoid the reserved static IPs. For a /24, a common split is .1–.20 static, .100–.254 DHCP.
  • Always leave room to grow — a /24 for a 50-device office gives plenty of room for expansion.

Frequently Asked Questions

How do I calculate a subnet?
Enter your IP address and choose a CIDR prefix. The network address is found by ANDing the IP with the subnet mask. The broadcast address is found by ORing the network address with the wildcard mask. Usable hosts = 2^(32−prefix) − 2.
How many usable hosts does a /24 subnet have?
A /24 subnet has 256 total addresses (2^8 = 256). The first address is the network address and the last is the broadcast address, leaving 254 usable host addresses.
What is the difference between subnet mask and wildcard mask?
The subnet mask has 1s in the network portion and 0s in the host portion (e.g. 255.255.255.0). The wildcard mask is the bitwise inverse — 0s in the network portion, 1s in the host portion (e.g. 0.0.0.255). Wildcard masks are commonly used in ACLs and routing protocols like OSPF.