Subnet Calculator
Enter an IP address and a prefix length (CIDR) to get the network address, broadcast address, subnet mask, host count and usable IP range instantly. Reverse lookup from a subnet mask and VLSM subnetting tables are built in, and the binary view shows exactly where the network bits end and the host bits begin. Useful for network design and for CCNA or Network+ study.
Calculate the Subnet Mask and Network Address
Pick an IP address and a prefix length, and every value is calculated as you type. Each prefix option lists its subnet mask, so the dropdown doubles as a CIDR to subnet mask conversion chart.
You can paste a full CIDR string such as 192.168.1.10/24 and it will be parsed. Typing a subnet mask (255.255.252.0, for example) switches the prefix length to the matching value automatically.
Same Network Check
Enter a second IP address to check whether it belongs to the same subnet as the network defined above.
Split into Subnets (VLSM)
Break the network from step 1 into smaller subnets and list the network address, usable IP range and broadcast address for each one. Handy for checking your answers on CCNA or Network+ subnetting questions.
Try Common Network Setups
Load a typical configuration with one tap and compare the results and the binary view.
How to Use
- Type an IP address (192.168.1.10, for example) and choose a prefix length such as /24. Pasting the full CIDR string 192.168.1.10/24 works too. If all you have is the subnet mask, enter it in the “Subnet mask (reverse lookup)” field and the prefix length switches to match.
- The network address, host count and the rest are calculated straight away, and the binary view shows the boundary between the network bits (blue) and the host bits (orange).
- Put a second address into “Same Network Check” to see whether it sits in the same subnet.
- Choose a new prefix length under “Split into Subnets (VLSM)” to list every resulting subnet. Your input is saved automatically and restored the next time you open the page.
How the Math Works
Frequently Asked Questions
- Why does a /24 have only 254 usable IP addresses?
- A /24 leaves 8 bits for the host part, so the total is 2^8 = 256 addresses. The first one is the network address and the last one is the broadcast address, and neither can be assigned to a host, which leaves 256 − 2 = 254 usable addresses.
- What prefix length is subnet mask 255.255.255.0?
- It is a /24. Written in binary, 255.255.255.0 starts with 24 consecutive ones, so the prefix length is 24. By the same logic 255.255.0.0 is a /16 and 255.255.255.128 is a /25. Enter any mask in the “Subnet mask (reverse lookup)” field above and the prefix length switches to match.
- How many hosts fit in subnet mask 255.255.252.0?
- 255.255.252.0 is a /22. The host part is 10 bits, so there are 2^10 = 1,024 addresses in total and 1,022 usable once the network and broadcast addresses are removed. For comparison, 255.255.254.0 is a /23 with 510 hosts and 255.255.248.0 is a /21 with 2,046 hosts.
- How many subnets do you get splitting a /24 into /26?
- Four. Extending the prefix from 24 to 26 adds 2 bits, so the network divides into 2^2 = 4 equal parts. Each subnet holds 64 addresses, of which 64 − 2 = 62 are usable by hosts. Use “Split into Subnets (VLSM)” above to list the network address and IP range of every subnet.
- What is VLSM (variable length subnet masking)?
- It is the practice of carving one network into subnets of different sizes to match how many hosts each segment actually needs. Inside a /24 you might give a 50 seat department a /26 (62 hosts) and a router link a /30 (2 hosts), varying the prefix length per segment so fewer addresses go to waste. Switch the prefix length above to see whether a given size covers the hosts you need.
- What is the difference between a private IP and a public IP?
- Private IP addresses work only inside a home or company network, and three ranges are reserved for them: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. A public IP address is unique across the whole internet. Devices at home hold private addresses and the router translates them to its public address through NAT.
- How do you tell whether two IP addresses are on the same network?
- Apply a bitwise AND between each IP address and the subnet mask to get its network address. If both results match, the two addresses share a network and can talk to each other directly without passing through a router. The “Same Network Check” above does this for you.