IP Subnet Calculator

Enter any IP address with a subnet mask to calculate complete network details including network address, broadcast address, and available host range.

Quick select subnet mask:

What is an IP Subnet Calculator?

An IP subnet calculator is a tool that takes an IP address and subnet mask as input and calculates all the relevant network information. This includes determining which network the IP address belongs to, the range of valid host addresses, and the special addresses reserved for network identification and broadcasting. Understanding these details is fundamental for network administrators who need to configure routers, firewalls, and other network devices.

Every device on an IP network requires two pieces of information to communicate: an IP address and a subnet mask. The IP address uniquely identifies the device, while the subnet mask defines the network boundaries. Our IP subnet calculator combines these two inputs to reveal the complete picture of your network segment. For quick CIDR notation calculations, you might also find our CIDR calculator useful.

Understanding IP and Subnet Mask Relationship

The subnet mask acts like a filter that separates the network portion from the host portion of an IP address. Where the mask has 255 (all 1s in binary), those bits represent the network. Where it has 0, those bits represent the host. This relationship determines how IP addresses are grouped into networks.

How to Use the IP Subnet Calculator

Using this calculator requires two inputs that work together to define your network:

Step 1: Enter the IP Address

Type any valid IPv4 address in dotted-decimal notation. This can be any address within the subnet you want to analyze - it doesn't need to be the network address. For example, if a computer has the IP address 172.16.45.100, enter that address to find out what network it belongs to.

Step 2: Enter the Subnet Mask

Enter the subnet mask in dotted-decimal format (like 255.255.255.0) or use the quick-select buttons for common masks. The subnet mask must be valid - it should consist of consecutive 1s followed by consecutive 0s in binary. If you need help converting between subnet mask formats, our subnet mask calculator provides additional tools.

Step 3: Review Results

Click Calculate to see comprehensive results including the network address, broadcast address, valid host range, and binary representations. The highlighted values show the most important information: network address, CIDR notation, and usable host count.

Understanding the Calculation Results

Network Address

The network address is calculated by performing a bitwise AND operation between the IP address and subnet mask. This address identifies the network itself and cannot be assigned to any host. All devices sharing the same network address are on the same subnet and can communicate directly without routing. For dedicated calculations, use our network address calculator.

Broadcast Address

The broadcast address allows a device to send data to all hosts on the network simultaneously. It's calculated by setting all host bits to 1 in the network address. Like the network address, the broadcast address is reserved and cannot be assigned to individual hosts. Our broadcast address calculator can help with specific broadcast calculations.

Host Range

The usable host range spans from the first usable address (network address + 1) to the last usable address (broadcast address - 1). These are the addresses you can actually assign to devices. For a /24 network, this gives you 254 usable addresses out of 256 total.

Wildcard Mask

The wildcard mask is the inverse of the subnet mask and is used in Cisco IOS for access control lists and OSPF configuration. Where the subnet mask has 255, the wildcard mask has 0, and vice versa. Learn more with our wildcard mask calculator.

IP Address Classes and Subnetting

Before CIDR, IP addresses were divided into classes based on their first octet:

Class First Octet Range Default Mask Network/Host Split
A1-126255.0.0.08 bits / 24 bits
B128-191255.255.0.016 bits / 16 bits
C192-223255.255.255.024 bits / 8 bits
D224-239N/A (Multicast)N/A
E240-255N/A (Reserved)N/A

While classful addressing is largely historical, understanding IP classes helps when working with older systems or studying networking fundamentals. Modern networks use CIDR (Classless Inter-Domain Routing) which allows any prefix length regardless of the traditional class boundaries.

Private IP Address Ranges

RFC 1918 defines three private IP address ranges that are not routable on the public internet:

  • 10.0.0.0 - 10.255.255.255 (10.0.0.0/8) - Over 16 million addresses, typically used in large enterprises
  • 172.16.0.0 - 172.31.255.255 (172.16.0.0/12) - Over 1 million addresses, common in medium organizations
  • 192.168.0.0 - 192.168.255.255 (192.168.0.0/16) - 65,536 addresses, standard for home and small office networks

When you enter an IP address, our calculator automatically identifies whether it falls within these private ranges or is a public address. You can verify any IP address type using our IP address validator tool.

Common Subnet Mask Reference

Here are the most frequently used subnet masks and their characteristics:

Subnet Mask CIDR Usable Hosts Common Use Case
255.255.255.252/302Point-to-point WAN links
255.255.255.248/296Very small networks
255.255.255.240/2814Small office segment
255.255.255.224/2730Department network
255.255.255.192/2662Medium segment
255.255.255.128/25126Large segment
255.255.255.0/24254Standard LAN
255.255.254.0/23510Large office floor
255.255.252.0/221,022Building network
255.255.0.0/1665,534Campus or enterprise

Binary Math Behind IP Subnetting

Understanding the binary operations behind subnetting helps you verify calculations and troubleshoot network issues. The key operation is the bitwise AND between the IP address and subnet mask.

Example: Finding Network Address

IP Address: 192.168.1.100

Binary: 11000000.10101000.00000001.01100100

Subnet Mask: 255.255.255.0

Binary: 11111111.11111111.11111111.00000000

AND Result (Network): 11000000.10101000.00000001.00000000

Decimal: 192.168.1.0

To explore binary representations of IP addresses in more detail, use our IP binary converter tool.

Practical Applications

Network Troubleshooting

When two devices can't communicate, one of the first things to check is whether they're on the same subnet. Enter both IP addresses with their subnet mask to see if they share the same network address. If not, they need a router to communicate.

IP Address Planning

Before deploying new devices, use this calculator to determine how many addresses are available in your subnet and what the valid range is. This prevents address conflicts and ensures proper network segmentation.

Firewall Configuration

When creating firewall rules, you often need to specify network ranges. This calculator shows you the exact boundaries of any subnet, helping you write accurate rules that don't accidentally block or allow unintended traffic.

DHCP Scope Planning

DHCP servers distribute IP addresses within a defined scope. Use this calculator to determine the valid host range for your DHCP scope, ensuring you don't include the network or broadcast addresses.

For more complex network planning involving multiple subnets of different sizes, our VLSM calculator can help you efficiently divide your address space. If you prefer a graphical view of your network segments, try our visual subnet calculator.

Quick Mask Reference
MaskCIDRHosts
255.255.255.0/24254
255.255.255.128/25126
255.255.255.192/2662
255.255.255.224/2730
255.255.255.240/2814
255.255.255.248/296
255.255.255.252/302

Frequently Asked Questions

The subnet mask depends on how many hosts you need in the network. Count the devices that need IP addresses (computers, servers, printers, phones, etc.), add room for growth (typically 50-100%), and choose a mask that provides enough addresses. For example, if you need 50 devices with room to grow to 100, a /25 mask (126 hosts) or /24 mask (254 hosts) would work. Most small office networks use /24 (255.255.255.0) as a standard choice.

Every subnet reserves two addresses for special purposes: the network address (first address, all host bits are 0) identifies the network itself in routing tables, and the broadcast address (last address, all host bits are 1) is used to send packets to all hosts simultaneously. These addresses serve essential network functions and cannot be assigned to individual devices, which is why a /24 network with 256 total addresses only has 254 usable host addresses.

This IP Subnet Calculator accepts the subnet mask in dotted-decimal format (like 255.255.255.0), which is how masks are often displayed in device configurations. The main Subnet Calculator uses a dropdown to select CIDR notation (like /24). Both provide the same results - choose whichever input format is more convenient for your situation. If you have a CIDR notation, the CIDR Calculator accepts that format directly.

Enter each IP address with the same subnet mask and compare the resulting network addresses. If both IPs produce the same network address, they're on the same subnet and can communicate directly. If the network addresses differ, the IPs are on different subnets and require a router to communicate. For example, 192.168.1.10 and 192.168.1.200 with mask 255.255.255.0 both have network address 192.168.1.0, so they're on the same subnet.

Private IP addresses (10.x.x.x, 172.16-31.x.x, 192.168.x.x) are reserved for internal network use and are not routable on the public internet. This allows organizations to use these addresses freely without coordination with internet authorities. Devices with private IPs typically use NAT (Network Address Translation) to access the internet through a router with a public IP. Our calculator identifies whether your IP is private or public to help you understand your network topology.

Related Network Tools

Looking to calculate subnets for your network? You can also find masks based on host requirements. For detailed analysis, visualize subnet divisions graphically. Network administrators often need to identify the starting address of subnets. Additionally, determine subnet broadcast addresses. Many users find it helpful to convert CIDR notation to IP ranges. For comprehensive planning, create wildcard masks for routing.