Subnet Calculator
Calculate subnet masks, network addresses, broadcast addresses, and usable host ranges from an IP address and CIDR notation.
How to Use This Subnet
To use the subnet calculator, enter your IP address and CIDR notation:
- IP Address Octets: Enter each of the four parts of the IP address separately. For example, for IP 192.168.1.0, enter 192, 168, 1, and 0. The IP address can be any address within the subnet you want to analyze (the calculator will find the actual network address).
- CIDR Notation: Enter the prefix length (the number of bits for the network). Common values are: /24 (255.255.255.0) for typical small office networks, /16 for medium networks, /8 for large networks, /30 for point-to-point links. The range is /8 to /30 in this calculator.
The calculator instantly provides six key results:
- Subnet Mask: The subnet mask in dotted decimal format (e.g., 255.255.255.0). This is the equivalent of the CIDR notation you entered.
- Network Address: The first address in your subnet. This identifies the entire network and cannot be assigned to a device.
- Broadcast Address: The last address in your subnet. This reaches all devices on the network and cannot be assigned to a device.
- Total Host Addresses: The total number of addresses in the subnet, calculated as 2^(32-CIDR).
- First Usable Host: The first IP address that can be assigned to a device (network address plus 1).
- Last Usable Host: The last IP address that can be assigned to a device (broadcast address minus 1).
Use these results to configure devices, routers, and network planning. In particular, the first and last usable addresses define the valid range for assigning to hosts on that subnet.
What Is Subnet?
A subnet calculator is a networking tool that takes an IP address and CIDR notation (subnet mask information) and calculates all the essential subnetting details: the subnet mask, network address, broadcast address, and the range of usable host addresses. Subnetting is the process of dividing a large network into smaller subnetworks called subnets. It is fundamental to modern IP networking and is essential knowledge for network administrators, IT professionals, and anyone designing or managing network infrastructure.
Subnetting exists for several important reasons. First, it improves efficiency by dividing large networks into smaller broadcast domains, reducing unnecessary traffic. Second, it enables hierarchical addressing, allowing for efficient routing and organization of large networks. Third, it provides security boundaries by isolating different departments or types of devices into separate subnets. Fourth, it enables flexible IP allocation, allowing different parts of an organization to have differently-sized networks based on their needs.
The fundamental concepts in subnetting are the network address, which identifies a network; the broadcast address, which reaches all devices on that network; and the usable host range, which contains the addresses that can be assigned to actual devices. The subnet mask (or CIDR notation) determines where the boundary is between the network portion of an IP address (which is the same for all devices on that subnet) and the host portion (which varies per device).
Understanding subnetting is critical for network administrators because incorrect subnetting can cause connectivity issues, security vulnerabilities, and inefficient use of IP address space. This calculator automates the complex bit-level calculations required for subnetting, eliminating manual errors and providing instant answers. Whether you are planning a network from scratch, adding a new subnet, or troubleshooting connectivity, this tool provides the information you need.
Formula & Methodology
The subnet calculator uses binary bit operations and the following logic:
| Calculation | Method |
|---|---|
| Subnet Mask | Create a 32-bit mask with CIDR number of 1s followed by 0s. E.g., /24 = 11111111.11111111.11111111.00000000 = 255.255.255.0 |
| Network Address | Bitwise AND the IP address with the subnet mask. This zeros out all host bits. |
| Broadcast Address | Bitwise OR the network address with the inverted subnet mask. This sets all host bits to 1. |
| Total Hosts | 2^(32 - CIDR). With /24, this is 2^8 = 256. |
| First Usable | Network address + 1 |
| Last Usable | Broadcast address - 1 |
- Subnet Mask Creation: A CIDR /24 means 24 network bits (1s) and 8 host bits (0s). The 24 ones represent 255.255.255, and the 8 zeros represent .0. The subnet mask always starts with 1s and ends with 0s with no mixing.
- Network Address: Apply the subnet mask to zero out the host portion. For example, 192.168.1.100 with /24 mask (255.255.255.0) becomes 192.168.1.0.
- Broadcast Address: Set all host bits to 1. For the 192.168.1.0/24 network, setting the last octet to 255 gives 192.168.1.255.
- Usable Addresses: Subtract 2 from the total (for network and broadcast addresses) to get usable host count. With /24, usable = 256 - 2 = 254.
Practical Examples
Example 1 - Standard /24 Subnet: You have IP 192.168.1.50 with /24 CIDR. Subnet mask: 255.255.255.0. Network address: 192.168.1.0 (all host bits zeroed). Broadcast address: 192.168.1.255 (all host bits set to 1). Total hosts: 2^8 = 256. First usable: 192.168.1.1. Last usable: 192.168.1.254. This provides 254 usable addresses, typical for small office networks.
Example 2 - Larger /16 Subnet: You have IP 172.16.50.100 with /16 CIDR. Subnet mask: 255.255.0.0. Network address: 172.16.0.0. Broadcast address: 172.16.255.255. Total hosts: 2^16 = 65,536. First usable: 172.16.0.1. Last usable: 172.16.255.254. This is a much larger network with 65,534 usable addresses, suitable for a university or large company.
Example 3 - Small /30 Subnet: You have IP 10.0.0.5 with /30 CIDR (point-to-point link). Subnet mask: 255.255.255.252. Network address: 10.0.0.4. Broadcast address: 10.0.0.7. Total hosts: 2^2 = 4. First usable: 10.0.0.5. Last usable: 10.0.0.6. A /30 subnet has only 2 usable addresses, perfect for connecting two routers or network devices directly with no room for other hosts.
Frequently Asked Questions
Disclaimer
CalcCenter provides these tools for informational and educational purposes. While we strive for accuracy, results are estimates and may not reflect exact real-world outcomes. Always verify important calculations independently.
Related Calculators
Bandwidth Calculator
Calculate the bandwidth you need for streaming, video calls, gaming, and more. Estimate total household bandwidth requirements based on connected devices and activities.
Download Time Calculator
Calculate how long it will take to download a file based on your internet speed. Supports all file sizes and connection types.
Data Storage Converter
Convert between data storage units instantly. Convert bytes, kilobytes, megabytes, gigabytes, terabytes, and petabytes with both binary and decimal standards.
Password Strength Calculator
Check how strong your password is and estimate how long it would take to crack. Calculate password entropy and get security recommendations.
People Also Calculate
AI API Cost Calculator 2026
Estimate the cost of using AI APIs from OpenAI, Anthropic, Google, and xAI. Calculate per-request, daily, monthly, and annual costs for GPT-5, Claude 4.6, Gemini 3, and Grok models based on token usage.
Cloud Compute Cost Calculator
Estimate your monthly and annual cloud computing costs. Calculate expenses for compute instances, storage, and data transfer across AWS, GCP, and Azure.
Home Theater Viewing & Speaker Distance Calculator
Calculate the optimal TV viewing distance, ideal screen size, and speaker placement for your home theater setup. Based on THX, SMPTE, and Dolby recommendations.