IPv4 Subnet & CIDR Calculator

Planning a network architecture requires absolute precision. Whether you are dividing an AWS VPC into public and private tiers, setting up Kubernetes pod CIDR blocks, or writing Nginx configuration allow/deny rules, a single miscalculated bit can lead to routing failures, IP conflicts, or security vulnerabilities. Our IPv4 Subnet Calculator eliminates the guesswork, instantly computing network addresses, broadcast addresses, and exact usable host ranges based on standard CIDR notation.

Unlike cloud-based networking tools, this calculator runs 100% locally in your browser using pure JavaScript. Your internal IP schemas, firewall rules, and VPC designs are never transmitted to any server. Whether you are generating hosts file entries, designing Docker bridge networks, or troubleshooting routing tables, your network topology remains completely private.

Subnet Calculator
Calculate IPv4 subnets, CIDR ranges, and host capacities entirely in your browser.
Network Address
Broadcast Address
First Usable Host
Last Usable Host
Total Usable Hosts
Subnet Mask
Wildcard Mask
IP Class
Type
Binary IP
Binary Mask
Click any value to copy
Subnet Splitter
Network Host Range Broadcast

This tool runs 100% in your browser; your data never leaves your device. Privacy details

What is CIDR Notation and Why It Replaced Classful Addressing

In the early days of the internet, IP addresses were divided into rigid classes (Class A, B, and C). This classful addressing system was highly inefficient; an organization that needed 300 IP addresses had to be assigned a Class B network, which provided over 65,000 addresses, wasting tens of thousands of IPs. To solve this IPv4 exhaustion problem, Classless Inter-Domain Routing (CIDR) was introduced in 1993.

CIDR notation allows for variable-length subnet masking (VLSM). Instead of defaulting to an 8-bit, 16-bit, or 24-bit mask, network administrators can specify exactly how many bits of the IP address represent the network prefix. For example, a /23 prefix provides 512 total addresses (510 usable), perfectly fitting a medium-sized office network without the waste of a Class B assignment. This flexibility is the foundation of modern internet routing and cloud infrastructure design.

Subnet Mask vs CIDR: Two Ways to Express the Same Thing

A subnet mask and a CIDR prefix are simply two different ways of representing the boundary between the network and host portions of an IP address. A subnet mask uses a dotted-decimal format, such as 255.255.255.0. In binary, this mask consists of twenty-four 1s followed by eight 0s. The 1s lock in the network portion, while the 0s define the available host addresses.

CIDR notation is much more concise. Instead of writing out the full dotted-decimal mask, you simply count the number of 1s in the binary representation. Since 255.255.255.0 has 24 active bits, its CIDR equivalent is simply /24. When configuring SSH connections, firewalls, or routers, you will frequently encounter both formats. Our calculator bridges this gap by seamlessly accepting and converting between both notations.

Common Subnet Reference Table (/8 through /32 with host counts)

While our calculator handles any custom subnetting task, memorizing a few common CIDR blocks can dramatically speed up your workflow. Here are the most frequently used subnets in enterprise and cloud networking:

  • /8 (255.0.0.0): 16,777,214 usable hosts. The default for a Class A network, often used for massive internal networks like 10.0.0.0/8.
  • /16 (255.255.0.0): 65,534 usable hosts. The default for a Class B network, commonly used as the primary CIDR block for an AWS VPC.
  • /24 (255.255.255.0): 254 usable hosts. The most common subnet size for home networks, small offices, and standard application tiers.
  • /28 (255.255.255.240): 14 usable hosts. Frequently used for small, isolated infrastructure components like database clusters or load balancers.
  • /31 (255.255.255.254): 2 usable hosts. A special subnet used exclusively for point-to-point links between two routers (RFC 3021).
  • /32 (255.255.255.255): 1 host. Represents a single, specific machine. Often used in firewall rules or when testing a CORS configuration for a specific backend IP.

Planning AWS VPC Subnets Without Wasting IP Space

When designing an AWS Virtual Private Cloud (VPC), efficient IP allocation is critical. AWS reserves the first four IP addresses and the last IP address of every subnet for internal routing and DNS purposes. This means a /28 subnet, which normally provides 14 usable hosts, will only provide 11 usable hosts in AWS.

To prevent IP exhaustion, it is standard practice to create a large VPC (e.g., a /16) and divide it into smaller subnets using a Subnet Splitter. A common architecture involves splitting the VPC into public subnets (for load balancers and NAT gateways) and private subnets (for application servers and databases). For example, you might carve out several /24 subnets for your web tier while reserving larger /22 subnets for a rapidly scaling containerized application. Planning this hierarchy in advance prevents overlap and ensures you don't run out of IPs as your infrastructure grows. If you are integrating external data sources, you might also need a connection string parser to ensure your subnets can securely route to your managed databases.

How Wildcard Masks Work in ACLs and Routing

A wildcard mask is the mathematical inverse of a subnet mask. While a subnet mask uses 1s to define the network and 0s for the hosts, a wildcard mask uses 0s to indicate "must match" and 1s to indicate "can be anything." For example, the subnet mask 255.255.255.0 translates to the wildcard mask 0.0.0.255.

Wildcard masks are extensively used in Cisco Access Control Lists (ACLs) and routing protocols like OSPF. They allow network administrators to specify non-contiguous IP ranges, which is impossible with standard CIDR notation. For instance, a wildcard mask of 0.255.0.255 could be used to match all IPs that share the same first and third octets, regardless of the second and fourth octets. Understanding how to calculate both the subnet mask and its corresponding wildcard mask is essential for robust network security engineering.

Why Your Network Architecture Stays Private

Network topology data—including internal IP ranges, VPC architectures, and subnet splits—is highly sensitive information. Uploading your IP schema to a third-party server exposes your infrastructure to potential reconnaissance and mapping by malicious actors.

We built this Subnet Calculator to operate entirely within your browser. By utilizing pure, client-side JavaScript bitwise operations, all mathematical calculations and CIDR conversions happen locally on your machine. No IP addresses, subnet designs, or configuration values are ever transmitted over the network, logged to a database, or shared with analytics providers. Your network remains invisible, secure, and entirely under your control.

How to Use the IPv4 Subnet & CIDR Calculator

  1. Enter the IPv4 address you want to calculate (e.g., 192.168.1.100).
  2. Select the CIDR prefix (e.g., /24) or type the subnet mask directly.
  3. The calculator will instantly update the network details below.
  4. Review the network address, broadcast address, and usable host range.
  5. Use the Subnet Splitter tool to divide your network into smaller, equal-sized subnets.
  6. Click any value in the table to instantly copy it for use in your config files.

Common Use Cases

  • Planning AWS VPC, Azure VNet, or Google Cloud VPC subnet architectures
  • Configuring firewall ACL rules and security group permissions
  • Designing office network segments and VLAN assignments
  • Writing Nginx allow/deny rules for specific network ranges
  • Setting up Docker bridge networks and Kubernetes pod CIDR blocks
  • Troubleshooting IP conflicts and routing issues

Frequently Asked Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation is a compact way to represent an IP address and its associated routing prefix. It appends a slash and a number (like /24) to the IP address, indicating how many bits of the address are used for the network portion. This method is more flexible and efficient than the old classful network system.

What is the difference between a network address and a broadcast address?

The network address is the first IP in a subnet and is used to identify the network itself (all host bits are 0). The broadcast address is the last IP in the subnet and is used to send data to all devices within that network simultaneously (all host bits are 1). Neither can be assigned to a specific host device.

How many usable hosts are in a /24 subnet?

A /24 subnet provides 256 total IP addresses. However, because the first address is reserved for the network identifier and the last is reserved for the broadcast address, there are 254 usable host addresses available for devices like computers, servers, and routers.

What is a wildcard mask used for?

A wildcard mask is the inverse of a subnet mask (where 0 means 'must match' and 1 means 'ignore'). It is commonly used in Access Control Lists (ACLs) on routers and firewalls, as well as in routing protocols like OSPF, to define a range of IP addresses to permit or deny.

How do I split a network into subnets?

To split a network into smaller subnets, you borrow bits from the host portion of the address to extend the network prefix. For example, splitting a /24 network into four equal subnets requires borrowing 2 bits, resulting in four /26 subnets, each with 62 usable hosts.

Why do /31 and /32 subnets have special rules?

Normally, a subnet loses 2 IPs to network and broadcast addresses. However, a /31 subnet (2 total IPs) is specially defined by RFC 3021 for point-to-point links, allowing both IPs to be assigned to the two connected routers. A /32 is a single host route representing exactly one IP address.

Is my IP address private or public?

Private IP addresses are reserved for local networks and cannot be routed over the public internet. The private ranges are: 10.0.0.0 to 10.255.255.255 (Class A), 172.16.0.0 to 172.31.255.255 (Class B), and 192.168.0.0 to 192.168.255.255 (Class C). If your IP falls outside these ranges (and isn't a loopback or link-local address), it is considered public.