IP Subnet Calculator

Calculate network address, broadcast address, and host range from any IP and subnet mask.

Enter an IP address and subnet mask (or CIDR prefix). Get the network address, broadcast address, usable host range, and total number of hosts for network planning.

Updated June 2026 · How this works

Worth knowing
How It Works
The formula, explained simply

IP subnet calculation determines how many devices can connect to a network and what their address range will be. When you enter an IP address and subnet information into this calculator, it performs bitwise operations to find the network boundaries.

The subnet mask or CIDR prefix defines which bits of an IP address represent the network portion versus the host portion. A /24 network means 24 bits are used for the network address, leaving 8 bits for individual host addresses. This creates 256 possible addresses, but the first (network address) and last (broadcast address) are reserved, leaving 254 usable host addresses.

The calculator uses bitwise AND operations between your IP address and the subnet mask to determine the network address. It then calculates the broadcast address by setting all host bits to 1. The first and last usable host addresses are the network address plus 1 and the broadcast address minus 1, respectively. This subnet calculator is essential for network administrators planning IP address allocation, configuring routers, and designing network segments.

Understanding these calculations helps you plan network capacity, avoid IP conflicts, and efficiently use available address space in both small office networks and large enterprise environments.

When To Use This
Right tool, right situation

Use this IP subnet calculator when designing network infrastructure, configuring routers, or planning IP address allocation for any organization. Network administrators rely on these calculations daily to avoid IP conflicts, optimize address space usage, and ensure proper network segmentation.

Subnet calculations become critical when setting up VLANs, planning network expansions, or troubleshooting connectivity issues. Before purchasing network equipment or configuring firewalls, you need to know exactly how many devices each network segment can support and what their address ranges will be.

The calculator is especially valuable during network migrations or when consolidating multiple smaller networks. It helps determine whether existing IP schemes will work with new requirements or if renumbering is necessary. Security teams also use subnet calculations to design network access controls and understand traffic flow between network segments.

Internet service providers and cloud architects use these calculations constantly when allocating customer networks or designing multi-tenant environments. Even small businesses benefit from proper subnet planning to ensure their network can grow without major reconfiguration as they add devices, servers, or remote locations.

Common Mistakes
Why results sometimes look wrong

The most common subnet calculation mistake is confusing network capacity with usable host addresses. A /24 network has 256 total addresses but only 254 usable ones - many people forget to subtract the network and broadcast addresses when planning device allocation.

Another frequent error occurs when calculating subnet masks manually. The bits in a valid subnet mask must be contiguous - all 1s followed by all 0s. A mask like 255.255.240.15 is invalid because it has 0s followed by 1s. Always verify that your subnet mask follows this rule.

Mixing up CIDR notation is also common. /28 doesn't mean 28 host addresses - it means 28 network bits, leaving only 4 host bits for 16 total addresses (14 usable). When someone says they need 30 host addresses, they need at least a /27 network (32 total, 30 usable), not /30 which only provides 2 usable addresses.

Incorrect broadcast address calculation often happens when working with non-standard subnet boundaries. The broadcast address isn't always the highest number in an obvious range - it's specifically the address with all host bits set to 1. Always use proper bitwise calculations rather than guessing based on decimal patterns.

The Math
Worked examples and deeper derivation

Subnet calculations rely on binary mathematics and bitwise operations. An IP address consists of 32 bits, typically written as four decimal octets (0-255). The subnet mask determines which bits represent the network versus host portions.

To calculate the network address, perform a bitwise AND operation: each bit of the IP address is AND'd with the corresponding bit in the subnet mask. When both bits are 1, the result is 1; otherwise, it's 0. For example, IP 192.168.1.100 (11000000.10101000.00000001.01100100 in binary) AND'd with mask 255.255.255.0 (11111111.11111111.11111111.00000000) produces network address 192.168.1.0.

The number of available host addresses equals 2^h, where h is the number of host bits. A /24 network has 8 host bits, providing 2^8 = 256 addresses. Subtracting 2 for the reserved network and broadcast addresses gives 254 usable hosts.

CIDR notation simplifies this by expressing the network portion as a prefix length. /24 means 24 network bits and 8 host bits, equivalent to subnet mask 255.255.255.0. Converting between CIDR and subnet mask involves understanding that each group of 8 consecutive 1-bits in the mask represents 255 in decimal notation.

Office Network Setup
IP: 192.168.10.50, CIDR: /24
Network is 192.168.10.0/24 with 254 usable host addresses from .1 to .254, perfect for a small office.
Server Subnet Planning
IP: 10.1.100.15, Mask: 255.255.252.0
Creates a /22 network (10.1.100.0) with 1,022 usable hosts, suitable for a large server farm.
Point-to-Point Link
IP: 203.0.113.1, CIDR: /30
Network 203.0.113.0/30 provides only 2 usable addresses (.1 and .2), ideal for router-to-router connections.

Common questions

How do I calculate network address from IP and subnet mask?
Perform a bitwise AND operation between the IP address and subnet mask. Each octet of the IP is AND'd with the corresponding subnet mask octet. For example, 192.168.1.100 AND 255.255.255.0 gives network address 192.168.1.0.
What is the difference between CIDR notation and subnet mask?
CIDR notation uses a slash followed by the number of network bits (/24), while subnet mask uses dotted decimal format (255.255.255.0). Both represent the same information - /24 equals 255.255.255.0, indicating 24 bits for network and 8 bits for hosts.
Why are there 2 fewer usable hosts than total addresses?
The first address in each subnet is reserved as the network address and the last address is reserved as the broadcast address. These cannot be assigned to hosts, so a /24 subnet with 256 total addresses has only 254 usable host addresses.

Need something this doesn't cover?

Suggest a tool — we'll build it →