Tools Network Tools

IP Subnet Calculator

Calculate subnets, CIDR, netmasks and host ranges

Enter an IPv4 address with a subnet mask or CIDR prefix to instantly calculate the network address, broadcast address, usable host range, wildcard mask and more. Supports all subnet sizes from /0 to /32.

IP Subnet Calculator

CIDR / Subnet Reference Table

CIDR Subnet Mask Wildcard Mask Total Addresses Usable Hosts

What is an IP Subnet Calculator?

An IP subnet calculator is a tool that takes an IPv4 address and a subnet mask (or CIDR prefix length) and computes key network properties: the network address, broadcast address, usable host range, wildcard mask, and number of available hosts. It is essential for network engineers, system administrators, and developers who need to plan IP addressing schemes, configure firewalls, or set up routing tables.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation is a compact way to represent an IP address and its associated subnet mask. It is written as IP/prefix, for example 192.168.1.0/24. The number after the slash indicates how many leading bits of the address are used for the network portion. A /24 means the first 24 bits are the network part, leaving 8 bits (256 addresses) for hosts. CIDR replaced the older classful addressing system (Class A, B, C) and allows for more flexible allocation of IP address space.

What is the difference between a subnet mask and a wildcard mask?

A subnet mask and a wildcard mask are inverses of each other. The subnet mask has 1-bits for the network portion and 0-bits for the host portion (e.g. 255.255.255.0 for a /24). The wildcard mask flips this: 0-bits for the network and 1-bits for the host portion (e.g. 0.0.0.255). Wildcard masks are commonly used in Cisco ACLs (Access Control Lists) and OSPF routing configurations, while subnet masks are used in most other networking contexts.

How do I calculate the number of usable hosts in a subnet?

The formula is 2^(32 - prefix) - 2 for subnets with a prefix of /30 or less. The two addresses subtracted are the network address (first address) and the broadcast address (last address), which cannot be assigned to hosts. For a /31, RFC 3021 allows both addresses to be used as a point-to-point link (2 usable). A /32 is a single host address (1 usable). For example, a /24 subnet has 2^8 - 2 = 254 usable host addresses.

What are the common subnet sizes?

The most commonly used subnet sizes are:

  • /8 (255.0.0.0) — 16,777,214 hosts — large enterprise or ISP networks
  • /16 (255.255.0.0) — 65,534 hosts — medium to large networks
  • /24 (255.255.255.0) — 254 hosts — the most common LAN subnet
  • /25 (255.255.255.128) — 126 hosts — splitting a /24 in half
  • /26 (255.255.255.192) — 62 hosts — smaller office networks
  • /27 (255.255.255.224) — 30 hosts — small workgroups
  • /28 (255.255.255.240) — 14 hosts — very small segments
  • /30 (255.255.255.252) — 2 hosts — point-to-point links
  • /32 (255.255.255.255) — 1 host — single host route

How is subnet calculation used in testing?

When testing network-dependent applications, you often need to configure test environments with specific subnet settings. A subnet calculator helps you quickly determine the correct network addresses, gateway IPs, and host ranges for test VMs, containers, or cloud instances. It is also useful when writing automated tests that validate firewall rules, ACLs, or IP whitelisting logic — you can verify which IPs fall within a given subnet range.