Subnet Calculator

Calculate network details from an IP address and CIDR prefix. Get network address, broadcast address, subnet mask, and usable host range.

/

How to Use This Calculator

  1. Enter an IP address (e.g., 192.168.1.0)
  2. Enter the CIDR prefix/subnet bits (e.g., 24 for a /24 network)
  3. Click "Calculate" to see the network details

Common Subnet Sizes

CIDR Subnet Mask Total IPs Usable Hosts
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/25255.255.255.128128126
/24255.255.255.0256254
/16255.255.0.065,53665,534
/8255.0.0.016,777,21616,777,214

Frequently asked questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation is a compact way to specify an IP address and its associated network mask. For example, 192.168.1.0/24 means the IP 192.168.1.0 with a 24-bit prefix (subnet mask 255.255.255.0).

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

The number of usable hosts equals 2^(32-CIDR) - 2. We subtract 2 because the first address is the network address and the last is the broadcast address. For /24, that's 2^8 - 2 = 254 usable hosts.

What is a subnet mask?

A subnet mask divides an IP address into network and host portions. For example, 255.255.255.0 (/24) means the first 24 bits identify the network, and the remaining 8 bits identify hosts on that network.

What is the difference between network and broadcast address?

The network address is the first address in a subnet (all host bits set to 0) and identifies the network itself. The broadcast address is the last address (all host bits set to 1) and is used to send data to all hosts on the subnet.