AI IP Subnet Calculator — Network Planning Made Simple
You are setting up a new VPC in AWS and need to divide a /16 network into subnets for production, staging, and development. Or you are configuring firewall rules and need to know exactly which IP addresses fall within a /24 block. Or a colleague asks if 10.0.3.47 is in the 10.0.2.0/23 subnet and you are not sure. These are everyday networking questions, and an IP subnet calculator answers them instantly.
Subnetting is one of those topics that every developer and sysadmin needs to understand but few enjoy calculating by hand. Converting between CIDR notation, subnet masks, wildcard masks, and address ranges involves binary math that is easy to get wrong. A good subnet calculator eliminates the mental arithmetic and lets you focus on network design decisions instead of bit manipulation.
IP Subnetting Fundamentals
What Is a Subnet?
A subnet (subnetwork) is a logical division of an IP network. Every IP address has two parts: the network portion and the host portion. The subnet mask determines where the boundary falls. In the address 192.168.1.100/24, the first 24 bits identify the network (192.168.1.0) and the remaining 8 bits identify the host (.100). This gives you 256 addresses in the subnet, of which 254 are usable for hosts (the first is the network address, the last is the broadcast address).
CIDR Notation
Classless Inter-Domain Routing (CIDR) notation uses a slash followed by the number of network bits. A /24 means 24 bits for the network, leaving 8 bits for hosts (256 addresses). A /16 means 16 network bits and 16 host bits (65,536 addresses). The smaller the CIDR number, the larger the network:
- /32 — single host (1 address)
- /24 — 256 addresses (254 usable)
- /16 — 65,536 addresses (65,534 usable)
- /8 — 16,777,216 addresses
Subnet Masks vs. CIDR
Subnet masks express the same information as CIDR notation but in dotted decimal format. A /24 equals 255.255.255.0. A /16 equals 255.255.0.0. The mask is a sequence of 1-bits (network portion) followed by 0-bits (host portion). While CIDR is more concise, many network devices and configuration files still use subnet masks, so you need to convert between them fluently.
Common Subnetting Scenarios
Cloud VPC Design
When creating a VPC in AWS, Azure, or GCP, you typically start with a large block like 10.0.0.0/16 and divide it into smaller subnets. A common pattern:
VPC: 10.0.0.0/16 (65,536 addresses)
Public subnets (internet-facing):
10.0.1.0/24 (AZ-a, 254 hosts)
10.0.2.0/24 (AZ-b, 254 hosts)
Private subnets (application tier):
10.0.10.0/24 (AZ-a, 254 hosts)
10.0.11.0/24 (AZ-b, 254 hosts)
Database subnets (isolated):
10.0.20.0/24 (AZ-a, 254 hosts)
10.0.21.0/24 (AZ-b, 254 hosts)
Using a subnet calculator, you can quickly verify that these ranges do not overlap and that each subnet has enough addresses for your expected workload. For looking up which geographic region an IP belongs to, pair this with our IP geolocation lookup tool.
Office Network Segmentation
Segmenting an office network improves security and performance. You might allocate:
- 192.168.1.0/24 — employee workstations (254 hosts)
- 192.168.2.0/24 — servers and infrastructure
- 192.168.3.0/24 — guest Wi-Fi (isolated)
- 192.168.4.0/24 — IoT devices (isolated)
Each segment gets its own firewall rules, preventing a compromised IoT device from accessing employee workstations or servers.
Firewall Rule Calculation
Firewall rules often use CIDR notation to specify source and destination ranges. If you need to allow traffic from 10.0.0.0 through 10.0.3.255, that is a /22 block (1,024 addresses). Getting the CIDR wrong means either blocking legitimate traffic or allowing unauthorized access. A subnet calculator makes this conversion instant and error-free.
The Binary Math Behind Subnetting
Understanding the binary is not strictly necessary with a calculator, but it helps you reason about networks intuitively. Take 192.168.1.0/26:
IP: 192.168.1.0
Binary: 11000000.10101000.00000001.00000000
Mask (/26): 11111111.11111111.11111111.11000000
Network: 192.168.1.0 (first address)
First host: 192.168.1.1
Last host: 192.168.1.62
Broadcast: 192.168.1.63 (last address)
Next subnet: 192.168.1.64
The /26 mask means 26 network bits and 6 host bits. 2^6 = 64 addresses per subnet. The network address has all host bits set to 0, and the broadcast address has all host bits set to 1. Usable host addresses are everything in between: 62 hosts per /26 subnet.
IPv6 Subnetting
IPv6 subnetting follows the same principles but with much larger address spaces. The standard allocation for a single LAN segment is a /64, which provides 2^64 (about 18 quintillion) host addresses. ISPs typically assign a /48 or /56 to customers, giving them thousands of /64 subnets to work with.
Common IPv6 subnet sizes:
- /128 — single host (loopback, point-to-point links)
- /64 — standard LAN subnet (required for SLAAC)
- /48 — typical site allocation (65,536 /64 subnets)
- /32 — ISP allocation
Unlike IPv4, you should never use subnets smaller than /64 for regular LANs in IPv6. Stateless Address Autoconfiguration (SLAAC) requires a /64 prefix to function correctly.
Private IP Ranges You Should Know
RFC 1918 defines three private IPv4 ranges that are not routable on the public internet:
- 10.0.0.0/8 — 16.7 million addresses (Class A)
- 172.16.0.0/12 — 1.05 million addresses (Class B range)
- 192.168.0.0/16 — 65,536 addresses (Class C range)
For cloud VPCs, 10.0.0.0/8 is the most common choice because it provides the largest address space. For home and small office networks, 192.168.0.0/16 is standard. The 172.16.0.0/12 range is often used for Docker networks and VPN tunnels.
There is also 100.64.0.0/10 (Carrier-Grade NAT) and 169.254.0.0/16 (link-local), which serve special purposes and should not be used for regular subnetting.
Subnet Calculator Use Cases for Developers
Even if you are not a network engineer, subnetting comes up regularly in development:
- Docker networking — understanding bridge networks, overlay networks, and container IP allocation. See our Docker command generator for related tooling.
- Kubernetes pod networking — calculating CIDR ranges for pod and service networks
- CI/CD pipelines — whitelisting IP ranges for deployment access
- API rate limiting — identifying requests from the same subnet
- Security groups — writing precise ingress and egress rules
A subnet calculator is not just for network engineers. Any developer working with cloud infrastructure, containers, or APIs benefits from quick subnet calculations. Combined with DNS lookup and SSL certificate checking, you have a complete toolkit for debugging connectivity issues.
Wrapping Up
Subnetting does not have to involve scribbling binary on a whiteboard. Whether you are designing a cloud VPC, segmenting an office network, or writing firewall rules, an IP subnet calculator gives you instant answers: network address, broadcast address, usable host range, wildcard mask, and the number of available hosts. It turns minutes of error-prone binary math into seconds of confident network planning.
The key concepts — CIDR notation, subnet masks, network vs. host bits, and private address ranges — are worth understanding even with a calculator at hand. They help you make better design decisions and communicate clearly with your team. But for the actual calculations, let the tool do the math.
Calculate Any Subnet Instantly
CIDR to range, subnet mask conversion, network and broadcast addresses, and visual subnet maps — all in your browser.
Try the AI IP Subnet Calculator →