Use our free subnet calculator to instantly find the network address, broadcast address, usable host range, and wildcard mask for any IPv4 address. Enter an IP like 192.168.1.1/24 and get the subnet mask, usable hosts, IP class, and binary mask in seconds.
Quick Answer: What Is a Subnet Calculator?
A subnet calculator takes an IPv4 address and CIDR prefix (like 192.168.1.0/24) and computes the network address, broadcast address, usable host range, subnet mask, and wildcard mask using binary ANDing. A /24 provides 254 usable hosts, a /16 provides 65,534, and a /8 provides 16,777,214. This tool helps network engineers, cloud architects, and CCNA students plan efficient IP allocations without manual binary math.

OSINT & Network Utility Expert
Robert specializes in network architecture, CIDR subnetting, and IP address management. He helps network engineers and cloud architects plan efficient, non-overlapping IP allocations for production environments.
View All Articles by Robert HarrisonA subnet calculator is a tool that performs the binary math required to divide an IP network into smaller, manageable segments called subnets. When you enter an IPv4 address like 192.168.1.1 and select a CIDR prefix such as /24, the ip subnet calculator computes the network address, broadcast address, usable host range, subnet mask, and wildcard mask instantly. Without this tool, engineers would need to convert every IP address to binary and perform manual ANDing operations — a process that takes minutes per calculation and is prone to human error.
Subnetting is fundamental to how the internet works. Every device connected to a network needs a unique IP address, and every network needs clear boundaries so routers know where to forward packets. Our subnet mask calculator handles this complexity automatically. Whether you are planning a corporate network with thousands of devices, configuring a CIDR block for cloud infrastructure, or studying for your CCNA certification, this tool gives you instant, accurate results for every subnet from /1 to /32.
Engineering Note: This subnet calculator uses server-side PHP bitwise operations for maximum accuracy. All calculations happen on the server — no JavaScript rounding errors, no floating-point issues, and results verified against RFC 1918 and RFC 4632 standards.
At the core of every subnet calculator, there is one fundamental operation: the bitwise AND. When you enter an IP address and a subnet mask, the calculator converts both to 32-bit binary numbers and compares them bit by bit. If both bits are 1, the result is 1. If either bit is 0, the result is 0. The output of this operation is the network address — the first address in your subnet and the identity of your entire network segment.
# Step 1: Convert the IP address to binary
192.168.1.55 = 11000000.10101000.00000001.00110111
# Step 2: Create the subnet mask from /24
/24 mask = 11111111.11111111.11111111.00000000 (255.255.255.0)
# Step 3: Bitwise AND to find the network address
Network = 11000000.10101000.00000001.00000000
= 192.168.1.0
# Step 4: Invert the mask to find the broadcast address
Broadcast = 11000000.10101000.00000001.11111111
= 192.168.1.255
This is why our ip subnet calculator works correctly even when you enter a host IP instead of the network address. The bitwise AND operation always finds the true network start. For IP-to-binary conversion practice, use our IP to Binary Converter.
Easy Memory Trick: For every bit you remove from the prefix, you double the number of hosts. Going from /25 (126 hosts) to /24 (254 hosts) doubles the size. Going from /24 to /23 (510 hosts) doubles it again.
This subnet cheat sheet shows every common CIDR prefix, the matching subnet mask, how many total IPs and usable hosts each block contains, and the typical use case for each size.
| CIDR | Subnet Mask | Total IPs | Usable Hosts | Typical Use |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 | Single host, loopback |
| /31 | 255.255.255.254 | 2 | 2 | Point-to-point link (RFC 3021) |
| /30 | 255.255.255.252 | 4 | 2 | WAN link between routers |
| /28 | 255.255.255.240 | 16 | 14 | Small office, IoT devices |
| /24 | 255.255.255.0 | 256 | 254 | Most common — home, SMB |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Medium enterprise campus |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Data center floor |
| /16 | 255.255.0.0 | 65,536 | 65,534 | AWS VPC, large ISP allocation |
| /8 | 255.0.0.0 | 16.7M | 16.7M | Class A block (10.0.0.0/8) |
For detailed CIDR breakdowns beyond this table, use our dedicated CIDR Calculator Tool which converts any CIDR notation to full IP ranges.
You will notice our subnet calculator shows two numbers: total IPs and usable hosts. The difference is always 2 (except for /31 and /32 special cases). Here is why:
The formula is: Usable Hosts = 2^(32 - prefix) - 2. For a /24: 2^8 = 256 total, minus 2 = 254 usable hosts. For a /16: 2^16 = 65,536 total, minus 2 = 65,534 usable hosts. For a /30 point-to-point link, you get exactly 2 usable addresses — perfect for a WAN connection between two routers.
AWS VPC Warning: Amazon Web Services reserves 5 IP addresses per subnet, not 2. These are: the network address (.0), VPC router (.1), DNS server (.2), reserved for future use (.3), and broadcast (.255). A /24 subnet in AWS gives you only 251 usable hosts, not 254. Azure and Google Cloud have similar reservations. Always verify with a subnet calculator before deploying cloud infrastructure.
VLSM (Variable Length Subnet Masking) is the modern standard for subnetting that allows different-sized subnets within the same network. Unlike FLSM (Fixed Length Subnet Masking) where every subnet is identical, VLSM lets you assign exactly the right number of addresses to each segment — eliminating IP waste and maximizing efficiency.
Imagine you have the network 192.168.1.0/24 and need three subnets: one for 100 users, one for 50, and one WAN link with 2 devices. With FLSM, you would divide into four equal /26 subnets of 62 hosts each. The 100-user subnet would not fit at all, and the WAN link would waste 60 addresses. With VLSM, you assign a /25 (126 hosts) for the large office, a /26 (62 hosts) for the medium office, and a /30 (2 hosts) for the WAN link.
# VLSM allocation for 192.168.1.0/24
Subnet 1: 192.168.1.0/25 = 126 usable hosts (Large Office)
Subnet 2: 192.168.1.128/26 = 62 usable hosts (Medium Office)
Subnet 3: 192.168.1.192/30 = 2 usable hosts (WAN Link)
# Remaining: 192.168.1.196 - 192.168.1.255 (available for growth)
VLSM Rule: Always start with the largest subnet first and work downward. If you start with the smallest, you risk overlapping address spaces when assigning larger blocks later. Use our subnet calculator to verify each allocation before configuring your routers.
VLSM is a required skill for the CCNA certification and is the standard method used in enterprise networks, ISP deployments, and cloud infrastructure. Every modern routing protocol (OSPF, EIGRP, BGP) supports VLSM.
Before 1993, IP addresses were assigned in rigid "classes" that caused massive waste. If a company needed 300 addresses, they had to take a Class B block with 65,536 addresses — throwing away over 65,000 IPs. This wasteful system was the primary driver of IPv4 address exhaustion.
| Class | Default Mask | Hosts | Problem |
|---|---|---|---|
| Class A (/8) | 255.0.0.0 | 16.7 million | Way too large for most organizations |
| Class B (/16) | 255.255.0.0 | 65,534 | Still too large, wasted IPs |
| Class C (/24) | 255.255.255.0 | 254 | Often too small for growing companies |
A company needing 500 IP addresses had to buy a Class B with 65,534 IPs — wasting over 65,000 addresses. CIDR (Classless Inter-Domain Routing), introduced in 1993, solved this by letting you use any prefix length. A /23 gives exactly 510 usable hosts — perfect for that 500-device company. This flexibility is what keeps the IPv4 internet running while the world transitions to IPv6 addressing.
RFC 1918 defines three private IP ranges reserved for internal use. These addresses are not routable on the public internet and must be translated using NAT (Network Address Translation) to communicate externally. Every subnet calculator should identify whether an address falls within these private ranges — our tool does this automatically.
| CIDR Block | Range | Total IPs | Typical Use |
|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 - 10.255.255.255 | 16,777,216 | Large enterprise, AWS VPC |
| 172.16.0.0/12 | 172.16.0.0 - 172.31.255.255 | 1,048,576 | Medium business, Docker |
| 192.168.0.0/16 | 192.168.0.0 - 192.168.255.255 | 65,536 | Home networks, small office |
When you enter a private IP into our subnet calculator, the results show "Private (RFC 1918)" in the address type field. This helps verify that your internal subnets are using the correct reserved ranges. To check if an IP has been flagged on security databases, use our IP Blacklist Checker.
Cloud infrastructure runs on subnetting. When you create a Virtual Private Cloud (VPC) in AWS, Azure, or Google Cloud, the very first decision is selecting a CIDR block. Getting this wrong can force costly network redesigns later.
The most common cloud networking mistake is using overlapping CIDR blocks between VPCs. If VPC-A uses 10.0.0.0/16 and VPC-B also uses 10.0.0.0/16, you cannot peer them. Use our subnet calculator to verify that every VPC uses a unique, non-overlapping range. A common strategy is: Production = 10.0.0.0/16, Staging = 10.1.0.0/16, Development = 10.2.0.0/16.
For verifying your cloud IP configurations, combine this tool with our Cloud IP Detection Tool and DNS Lookup for complete infrastructure auditing.
Subnetting is one of the most effective ways to implement network security. By creating logical boundaries between departments, device types, and security zones, you control exactly which devices can communicate with each other. This is the foundation of the Zero Trust architecture model.
Large flat networks suffer from broadcast storms where devices constantly send ARP requests and discovery packets. In a /16 network with 65,000 devices, every broadcast reaches all 65,000 hosts. Dividing into /24 subnets limits broadcasts to 254 devices each, dramatically improving network performance and reducing attack surface.
# Enterprise subnet segmentation plan
10.0.1.0/24 = Management (executive devices)
10.0.2.0/24 = Engineering (developer workstations)
10.0.3.0/24 = Guest Wi-Fi (isolated, no internal access)
10.0.10.0/24 = Database servers (restricted ACL)
10.0.20.0/24 = VOIP phones (QoS priority)
# Firewall rules enforce inter-subnet traffic policies
In a flat network, if a hacker compromises a guest laptop, they can immediately scan every device — including your database servers. With proper subnet isolation, the attacker is trapped within the guest subnet and cannot reach the database subnet without passing through a monitored firewall. For checking if your public-facing IP has been compromised, run it through our IP Fraud Score Checker and Tor Exit Node Detector.
A wildcard mask is the bitwise inverse of a subnet mask. Where the subnet mask has a 1, the wildcard has a 0, and vice versa. For a /24 subnet (255.255.255.0), the wildcard mask is 0.0.0.255. Our wildcard mask calculator computes this automatically for every prefix.
# Cisco ACL using wildcard mask
access-list 101 permit ip 192.168.1.0 0.0.0.255 any
# This permits all traffic from 192.168.1.0/24
# The wildcard 0.0.0.255 means: match first 3 octets, ignore last
# OSPF network statement
router ospf 1
network 10.0.0.0 0.0.255.255 area 0
Our subnet calculator automatically calculates the wildcard mask for every CIDR block you enter. For verifying how your firewall handles these rules, check open ports using our Open Port Scanner Tool.
Supernetting is the reverse of subnetting — instead of dividing a network into smaller pieces, you combine multiple small networks into one larger block. This is also called route aggregation or route summarization, and it is essential for keeping internet routing tables manageable.
# Four separate /24 blocks:
192.168.0.0/24 (192.168.0.0 - 192.168.0.255)
192.168.1.0/24 (192.168.1.0 - 192.168.1.255)
192.168.2.0/24 (192.168.2.0 - 192.168.2.255)
192.168.3.0/24 (192.168.3.0 - 192.168.3.255)
# Combined into one /22 supernet:
192.168.0.0/22 (192.168.0.0 - 192.168.3.255)
# 4 routing entries → 1 routing entry
ISPs use supernetting extensively to keep global routing tables manageable. Supernetting only works with contiguous blocks that align on binary boundaries. You cannot supernet 192.168.1.0/24 and 192.168.3.0/24 because they are not contiguous. Use our subnet calculator to verify block boundaries before attempting route aggregation. For ASN and routing information, check our ASN Lookup Tool.
For most home networks, the default 192.168.1.0/24 subnet works perfectly. It provides 254 usable addresses — more than enough for computers, phones, tablets, smart TVs, IoT devices, and security cameras. Your router typically assigns itself 192.168.1.1 as the gateway and uses DHCP to distribute addresses from a configured range.
If you run a home lab, work from home, or have extensive IoT devices, creating separate subnets adds security and organization. Use 192.168.1.0/24 for trusted personal devices and 192.168.2.0/24 for IoT devices like smart plugs and cameras. This prevents a compromised IoT device from accessing your work laptop. Many advanced home routers and firewalls (pfSense, Ubiquiti, MikroTik) support multiple VLANs with separate subnets.
To verify your home router is not leaking information, run our Browser Leak Test and check your WebRTC Leak Status.
For developers who need to perform subnet calculations programmatically, here are ready-to-use implementations in PHP and Python. Both use the same bitwise AND logic as our online subnet calculator.
# PHP: Calculate subnet from IP and CIDR
$ip = ip2long('192.168.1.55');
$cidr = 24;
$mask = ~((1 << (32 - $cidr)) - 1);
$network = long2ip($ip & $mask);
$broadcast = long2ip(($ip & $mask) | ~$mask);
echo "Network: $network, Broadcast: $broadcast";
# Python: Calculate subnet using ipaddress module
import ipaddress
net = ipaddress.ip_network('192.168.1.0/24', strict=False)
print(f"Network: {net.network_address}")
print(f"Broadcast: {net.broadcast_address}")
print(f"Usable: {list(net.hosts())[0]} - {list(net.hosts())[-1]}")
For verifying DNS resolution and reverse lookups within your subnets, combine these scripts with our Reverse DNS Lookup and WHOIS Domain Lookup tools.
A subnet calculator takes an IPv4 address and a CIDR prefix (like /24) and performs bitwise AND operations to compute the network address, broadcast address, usable host range, subnet mask, and wildcard mask. It automates the binary math that would take minutes by hand.
A /24 has 256 total IPs. Subtract 2 for the network address and broadcast address, giving you 254 usable hosts. The formula is 2^(32-24) - 2 = 254. In AWS, the number drops to 251 due to 5 reserved addresses.
FLSM uses the same subnet mask for every subnet, creating equal segments. VLSM allows different masks for different subnets, matching each segment's actual need. VLSM is more efficient and is the standard in modern networking.
A subnet mask is a 32-bit number that separates the network portion from the host portion. For example, 255.255.255.0 (/24) means the first 24 bits identify the network and the last 8 bits identify hosts. Routers use it to determine if traffic stays local or gets forwarded.
A wildcard mask is the inverse of the subnet mask. For /24, the wildcard is 0.0.0.255. It is primarily used in Cisco ACLs and OSPF routing to specify which IP bits to inspect during packet filtering and route advertisements.
Use 10.0.0.0/16 for your main VPC (65,534 usable IPs). Then divide into /24 subnets for each tier. AWS reserves 5 IPs per subnet, so a /24 gives 251 usable hosts. Leave gap space between subnets for future expansion.
CIDR notation uses a slash followed by the number of network bits (like /24). It replaced the old Class A/B/C system and allows flexible subnet sizes. /24 equals 255.255.255.0, /16 equals 255.255.0.0. For detailed analysis, use our CIDR Calculator.
The first IP is the network address, used by routers to identify the subnet. The last IP is the broadcast address, used to send data to all devices simultaneously. Assigning either to a device breaks routing logic. The only exception is /31 subnets (RFC 3021) for point-to-point links.
Complete your network architecture with our free toolkit.
Find the network address, broadcast address, usable hosts, and wildcard mask for any IPv4 address. Our free subnet calculator works instantly — perfect for AWS VPC planning, VLSM subnetting, and network architecture.