What is Subnet Calculator

The Subnet Calculator is a client-side networking tool that computes IPv4 subnet details from a CIDR notation input (e.g., 10.0.0.0/24). Given an IP address and prefix length, it calculates five values: the network address (the first address in the subnet), the broadcast address (the last address), the subnet mask in dotted-decimal format, the usable host range (excluding network and broadcast addresses), and the total number of usable hosts. The calculator uses bitwise arithmetic to perform the calculations: it converts the IP to a 32-bit integer, applies the subnet mask, and derives the network and broadcast addresses. The tool validates the input format (four octets 0-255, prefix 0-32) and provides clear error messages for invalid inputs. This is essential for network administrators, DevOps engineers, and developers working with VPCs, Kubernetes networking, Docker networks, and any infrastructure where CIDR blocks define network boundaries.

How to Use Subnet Calculator

  1. Step 1: Enter an IPv4 address with CIDR prefix in the input field (e.g., 192.168.1.0/24, 10.0.0.0/16, or 172.16.0.0/12).
  2. Step 2: Click Transform. The calculator performs bitwise operations to compute all subnet details.
  3. Step 3: The output shows: Network address, Broadcast address, Subnet mask, Usable host range, and Total usable hosts.
  4. Step 4: For /31 and /32 prefixes, the tool correctly handles point-to-point links (2 hosts) and host routes (1 host) respectively.

Why Use Subnet Calculator

CIDR notation is the standard for defining network segments in cloud infrastructure (AWS VPCs, GCP subnets, Azure VNets), Kubernetes pod networks, Docker Compose networks, and firewall rules. Calculating the network address, broadcast address, and host range from a CIDR block requires mental binary math that is error-prone. The Subnet Calculator does this instantly and correctly, eliminating subnetting mistakes that can cause connectivity issues, security misconfigurations, or IP address exhaustion.

Privacy & Security

This tool runs entirely in your browser — no data ever leaves your device. There is no server round-trip, no upload, no logging, and no account required. Your input is processed locally using client-side JavaScript and is never stored, transmitted, or accessible to anyone else. When you close the tab, everything disappears.

Frequently Asked Questions

What is the difference between /24 and /25?

<p>/24 gives 256 addresses (254 usable hosts). /25 splits that into two subnets of 128 addresses each (126 usable hosts). Each bit added to the prefix halves the available addresses.</p>

Can I calculate IPv6 subnets?

<p>No. This tool handles IPv4 subnets only. IPv6 subnetting uses a different notation (typically /64 for LANs) and much larger address spaces.</p>

Why are network and broadcast addresses excluded from the host count?

<p>The network address identifies the subnet itself and the broadcast address is used for broadcast traffic. Neither can be assigned to a host, so they are excluded from the usable count.</p>

What is a /32 prefix?

<p>/32 means a single host — the network and broadcast addresses are the same, giving exactly one usable IP. This is used for host routes in routing tables and for assigning a specific public IP to a single server.</p>

What is a /0 prefix?

<p>/0 matches all IP addresses (the entire IPv4 space). The subnet mask is 0.0.0.0 and the network address is 0.0.0.0. This is used as a default route in routing tables, meaning "send to any destination".</p>

How do I calculate subnets for a VPC?

<p>Start with your VPC CIDR (e.g., 10.0.0.0/16) and divide it into smaller subnets. Each /24 within the /16 gives 254 usable hosts. Use the calculator to verify the network and broadcast addresses for each subnet you plan to create.</p>

Why does the calculator show 2 fewer hosts than the total?

<p>The network address (first) and broadcast address (last) are reserved and cannot be assigned to hosts. A /24 has 256 total addresses but 254 usable hosts (256 minus 2).</p>