Subnet Calculator

Calculate IP subnet information from CIDR

Embed this calculator

How to Use This Calculator

This subnet calculator helps network administrators, IT professionals, and students quickly determine network boundaries and host capacity for any IPv4 address range. Whether you are configuring a router, planning network infrastructure, or studying for a certification exam, this tool provides instant results.

Step 1: Enter an IP Address - Type any valid IPv4 address in the first field. You can enter any address within the network you want to analyze, such as 192.168.1.100, 10.0.0.1, or 172.16.50.25. The calculator automatically determines the correct network address based on your input and selected subnet mask.

Step 2: Select the Subnet Mask - Choose the CIDR prefix length or subnet mask from the dropdown menu. The dropdown displays both the CIDR notation (such as /24) and the equivalent dotted-decimal subnet mask (such as 255.255.255.0), along with the total number of addresses. Common choices include /24 for small networks with 254 usable hosts, /16 for medium networks with 65,534 usable hosts, and /8 for large enterprise networks.

Step 3: View the Results - Click the Calculate button to see comprehensive subnet information. The results display the network address, broadcast address, subnet mask in dotted-decimal format, wildcard mask used in access control lists, the complete usable host range, total number of usable hosts, and the IP address class.

Use these results to verify network configurations, plan IP address allocation schemes, troubleshoot connectivity issues, or complete networking assignments and exam questions.

Understanding Subnetting

What Are IP Addresses? Every device connected to a network needs a unique identifier called an IP address. In IPv4, this address consists of 32 bits, typically displayed as four decimal numbers separated by dots, such as 192.168.1.100. Each number, called an octet, ranges from 0 to 255. These addresses allow devices to locate and communicate with each other across local networks and the internet.

The Purpose of Subnet Masks A subnet mask determines which portion of an IP address identifies the network and which portion identifies individual hosts within that network. Think of it like a postal address where the city name identifies the general area and the street address identifies the specific location. The subnet mask uses consecutive binary 1s for the network portion and 0s for the host portion. For example, 255.255.255.0 means the first 24 bits define the network, leaving 8 bits for host addresses.

CIDR Notation Explained Classless Inter-Domain Routing (CIDR) notation provides a compact way to express subnet masks. Instead of writing the full dotted-decimal mask 255.255.255.0, network engineers write /24, indicating that 24 bits are reserved for the network portion. CIDR replaced the older classful addressing system, which limited networks to fixed sizes of /8, /16, or /24. With CIDR, you can create networks of any practical size, such as /27 with 30 usable hosts or /20 with over 4,000 hosts.

Network vs Host Portion Within any IP address, the bits are divided between identifying the network and identifying the specific host. Using 192.168.1.100/24 as an example, the network portion is 192.168.1 (the first 24 bits), and the host portion is 100 (the last 8 bits). All devices sharing the same network portion can communicate directly without routing. The network address (192.168.1.0) has all host bits set to zero, while the broadcast address (192.168.1.255) has all host bits set to one.

Why Subnetting Matters Subnetting provides several critical benefits for network management. It improves security by isolating sensitive systems into separate network segments. It reduces broadcast traffic by limiting broadcasts to smaller domains. It enables better organization of network resources by department, floor, or function. It also allows more efficient use of IP address space by allocating only the addresses actually needed for each segment.

Private IP Address Ranges The Internet Assigned Numbers Authority (IANA) reserved three address blocks for private networks that do not require internet routing. These ranges include 10.0.0.0/8 (over 16 million addresses), 172.16.0.0/12 (about 1 million addresses), and 192.168.0.0/16 (over 65,000 addresses). Organizations worldwide reuse these addresses internally, relying on Network Address Translation (NAT) to access the public internet.

Frequently Asked Questions

What is a subnet?

A subnet, short for subnetwork, is a logical subdivision of an IP network. By creating subnets, network administrators can divide a large network into smaller, more manageable segments. Each subnet operates as an independent network with its own range of IP addresses. Devices within the same subnet can communicate directly, while communication between different subnets requires a router. Subnetting improves network performance, enhances security through isolation, and allows more efficient use of IP addresses.

What are the most common subnet masks?

The most frequently used subnet masks include /24 (255.255.255.0) for small office and home networks with up to 254 hosts, /16 (255.255.0.0) for medium to large enterprise networks with up to 65,534 hosts, /30 (255.255.255.252) for point-to-point links between routers providing exactly 2 usable addresses, and /8 (255.0.0.0) for the largest private networks like the 10.x.x.x range. Cloud providers and data centers commonly use /28, /27, and /26 for virtual machine subnets.

How do I calculate the number of hosts per subnet?

The formula for calculating usable hosts is 2^(32-CIDR) - 2. The exponent represents the number of host bits remaining after the network portion. You subtract 2 because the first address (all host bits zero) is reserved as the network address and the last address (all host bits one) is reserved as the broadcast address. For example, a /24 network has 8 host bits, so 2^8 = 256 total addresses minus 2 reserved equals 254 usable host addresses.

What is the difference between private and public IP addresses?

Public IP addresses are globally unique and routable on the internet, assigned by Internet Service Providers and regional registries. Private IP addresses are reserved for internal networks and cannot be routed on the public internet. The private ranges (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16) can be reused by any organization. Devices with private addresses access the internet through Network Address Translation (NAT), which converts private addresses to public ones at the network boundary.

What does CIDR notation actually mean?

CIDR stands for Classless Inter-Domain Routing. The number following the slash indicates how many bits of the 32-bit IPv4 address are used for the network portion. For instance, /24 means 24 bits identify the network, leaving 8 bits for hosts. This notation replaced classful addressing (Class A, B, C) because it allows flexible subnet sizes. CIDR enables route aggregation, reducing internet routing table sizes by summarizing multiple contiguous networks into a single entry.

Why is /24 the most common subnet size?

The /24 subnet has become the de facto standard for several practical reasons. It provides 254 usable addresses, which suits most small to medium network segments. It aligns with the octet boundary, making mental math easier since you only vary the last number (0-255). It corresponds to the historical Class C network size, so legacy documentation and equipment default to this mask. It also balances having enough addresses for growth while keeping broadcast domains reasonably small.

What is the difference between supernetting and subnetting?

Subnetting divides a larger network into smaller segments by borrowing bits from the host portion to create more network addresses. Supernetting, also called route aggregation or summarization, does the opposite by combining multiple smaller networks into a larger one by reducing the network bits. For example, subnetting 192.168.0.0/24 into four /26 networks creates smaller segments, while supernetting four /24 networks (192.168.0.0 through 192.168.3.0) into 192.168.0.0/22 creates one larger aggregate for routing efficiency.

How does IPv6 subnetting differ from IPv4?

IPv6 subnetting follows similar principles but with much larger address space. IPv6 addresses are 128 bits long compared to 32 bits for IPv4. The standard allocation gives each site a /48 prefix, allowing 65,536 /64 subnets, each with 18 quintillion host addresses. IPv6 eliminates the need for NAT since addresses are abundant. Most IPv6 subnets use /64 because Stateless Address Autoconfiguration (SLAAC) requires 64 bits for the interface identifier. Unlike IPv4, address conservation is rarely a concern with IPv6.

Subnet Examples

Home Network (/24) - Most residential routers use 192.168.1.0/24 or 192.168.0.0/24 by default. This configuration provides 254 usable addresses (192.168.1.1 through 192.168.1.254), which is more than enough for home devices including computers, phones, tablets, smart TVs, game consoles, and IoT devices. The router typically assigns itself .1 or .254 and uses DHCP to distribute addresses to other devices. This subnet size keeps configuration simple while providing ample room for any household.

Enterprise Campus (/16) - Large organizations often allocate a 10.x.0.0/16 or 172.16.0.0/16 block for their entire campus, then subdivide it into smaller departmental subnets. With 65,534 usable addresses, a /16 can accommodate thousands of devices while leaving room for further subnetting. For example, 10.50.0.0/16 might be divided into 10.50.1.0/24 for accounting, 10.50.2.0/24 for engineering, and 10.50.10.0/24 for servers. This hierarchical approach simplifies routing and access control policies.

Small Office (/28) - A small office or retail location with 10-14 devices might use a /28 subnet like 192.168.100.0/28. This provides exactly 14 usable addresses (192.168.100.1 through 192.168.100.14), with network address 192.168.100.0 and broadcast address 192.168.100.15. Using smaller subnets conserves address space when multiple locations share a larger allocation and limits broadcast traffic. Many cloud providers use /28 subnets for small virtual machine deployments.

Point-to-Point Link (/30) - Router-to-router connections only need two addresses, making /30 the traditional choice. A link using 10.0.0.0/30 has network 10.0.0.0, usable hosts 10.0.0.1 and 10.0.0.2, and broadcast 10.0.0.3. Some modern networks use /31 for point-to-point links (per RFC 3021), eliminating the network and broadcast addresses entirely since they are unnecessary on links with exactly two endpoints.

Networking Tips

Plan Your Address Space - Before implementing any network, create a documented IP addressing plan. Allocate address blocks hierarchically, reserving ranges for future growth. Group related subnets together so they can be summarized in routing tables. Leave gaps between allocations to allow expansion without renumbering. A well-designed addressing scheme makes troubleshooting easier and reduces errors during network changes.

Use Variable Length Subnet Masking (VLSM) - VLSM allows you to assign different subnet sizes based on actual requirements rather than using one size everywhere. Allocate large subnets (/24 or bigger) for user segments with many devices, medium subnets (/27 or /28) for server VLANs, and small subnets (/30 or /31) for point-to-point links. This approach maximizes address efficiency while ensuring each segment has appropriate capacity.

Document Everything - Maintain accurate records of all IP allocations, including subnet boundaries, gateway addresses, DHCP ranges, and static assignments. Use spreadsheets, IP address management (IPAM) software, or network documentation tools. Include information about which devices use which addresses and why certain ranges are reserved. Good documentation prevents address conflicts and speeds up troubleshooting when problems occur.

Reserve Addresses Consistently - Establish conventions for special addresses within each subnet. Many organizations reserve .1 for the default gateway, .2-.10 for network infrastructure like switches and access points, and .250-.254 for servers or management interfaces. The remaining addresses go into the DHCP pool. Consistent addressing across all subnets reduces confusion and makes network management more intuitive for your team.

The subnetting formula

Calculating subnet properties follows straightforward mathematical rules once you understand the binary foundation.

Total addresses: 2(32-CIDR). A /24 network has 28 = 256 total addresses.

Usable hosts: 2(32-CIDR) - 2. Subtract 2 for the network and broadcast addresses. A /24 has 254 usable hosts.

Network address: Apply the subnet mask using binary AND operation to the IP address. All host bits become zero.

Broadcast address: Set all host bits to 1. This is the network address OR'd with the wildcard mask.

Common subnets

  • /24 (255.255.255.0): Most common for small networks (254 hosts)
  • /16 (255.255.0.0): Large networks (65,534 hosts)
  • /30 (255.255.255.252): Point-to-point links (2 hosts)
  • /8 (255.0.0.0): Class A networks (16M hosts)

Private IP ranges

  • 10.0.0.0/8: Class A private (10.0.0.0 - 10.255.255.255)
  • 172.16.0.0/12: Class B private (172.16.0.0 - 172.31.255.255)
  • 192.168.0.0/16: Class C private (192.168.0.0 - 192.168.255.255)

Did you know?

  • The entire internet IPv4 address space contains approximately 4.3 billion addresses, which were officially exhausted in 2011.
  • Private IP ranges (10.x.x.x, 192.168.x.x, and 172.16.x.x through 172.31.x.x) can be reused by any organization because they are never routed on the public internet.
  • IPv6 provides 340 undecillion addresses, which is enough to assign roughly 100 addresses to every atom on the surface of the Earth.
  • The /31 subnet mask was originally considered invalid, but RFC 3021 standardized it for point-to-point links, eliminating the need for network and broadcast addresses.
  • CIDR was introduced in 1993 to slow IPv4 exhaustion by enabling more efficient address allocation than the original classful system.
Created by
The Ugly Empire Team
Software engineers and data specialists with backgrounds in financial services, mathematics, and educational technology. Our team builds tools using industry-standard formulas verified against authoritative sources.
Last reviewed: January 2026
Regular accuracy audits
Formulas from authoritative sources
Privacy-first: calculations run locally
Disclaimer: This calculator provides estimates for informational purposes only. Results should not be considered financial, legal, medical, or professional advice. Always consult qualified professionals for important decisions. We strive for accuracy but cannot guarantee results will match real-world outcomes due to varying factors and individual circumstances.