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.
—
Send feedback
💡 Share your idea or report a problem
✓ Thanks! We'll take a look.
Learn more
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.
Common questions
Need something this doesn't cover?
Suggest a tool — we'll build it →