IPv4 Subnet / Mask Calculator
Enter an IPv4 address and either a CIDR prefix (like /24 or 24) or a dotted subnet mask (like 255.255.255.0).
Tip: Press Enter in either field to calculate.
What is an IP mask calculator?
An IP mask calculator is a networking tool that takes an IPv4 address and subnet mask, then instantly computes the key values you need to design or troubleshoot a network. Instead of manually converting decimal to binary and counting bits, the calculator gives you practical outputs such as network address, broadcast address, usable host range, and total host count.
In day-to-day operations, this is one of the fastest ways to avoid subnetting mistakes. Whether you are configuring routers, VLANs, firewall rules, DHCP scopes, or cloud security groups, understanding the relationship between an address and its mask is essential.
How subnet masks work
IPv4 addresses are 32 bits long. A subnet mask is also 32 bits long and separates the address into two parts:
- Network bits (fixed portion identifying the subnet)
- Host bits (variable portion identifying devices inside that subnet)
In binary, mask bits are contiguous ones followed by zeros. For example:
255.255.255.0=11111111.11111111.11111111.00000000=/24255.255.255.192=11111111.11111111.11111111.11000000=/26
CIDR notation (/24, /27, etc.) simply counts the number of 1 bits in the mask.
Why this matters in real networks
Accurate mask calculations directly affect reachability and security. A single incorrect prefix can place a host in the wrong subnet, break communication with gateways, or unintentionally broaden access in ACL rules.
Teams often use mask calculators during:
- IP planning and address allocation
- LAN and VLAN segmentation
- Routing table validation
- NAT and firewall troubleshooting
- Cloud VPC/subnet design
Quick subnet reference
Common prefixes and host capacity
- /8 → mask 255.0.0.0 → 16,777,216 total addresses
- /16 → mask 255.255.0.0 → 65,536 total addresses
- /24 → mask 255.255.255.0 → 256 total addresses (254 typical usable)
- /25 → mask 255.255.255.128 → 128 total addresses
- /26 → mask 255.255.255.192 → 64 total addresses
- /27 → mask 255.255.255.224 → 32 total addresses
- /28 → mask 255.255.255.240 → 16 total addresses
- /29 → mask 255.255.255.248 → 8 total addresses
- /30 → mask 255.255.255.252 → 4 total addresses (2 typical usable)
For most subnets, usable hosts = total addresses minus network and broadcast addresses.
Special cases include /31 (point-to-point links) and /32 (single host route).
Worked example
Suppose you have 192.168.10.77/27. A /27 mask means 27 network bits and 5 host bits.
That leaves 32 addresses per subnet. Subnets in the last octet increase in blocks of 32:
- 0–31
- 32–63
- 64–95
- 96–127
- ...
Because 77 falls in the 64–95 block:
- Network address:
192.168.10.64 - Broadcast address:
192.168.10.95 - Usable host range:
192.168.10.65to192.168.10.94
Common mistakes to avoid
1) Non-contiguous masks
Masks like 255.0.255.0 are invalid in CIDR subnetting because mask bits must be contiguous ones followed by zeros.
2) Confusing host IP with network IP
Assigning the network address or broadcast address to a host can break connectivity.
3) Wrong default gateway assumptions
Devices can only directly reach hosts inside the same subnet. Everything else must go through a valid gateway in that subnet.
4) Ignoring private vs public ranges
Private IPv4 space includes 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.
These are not globally routable on the public internet.
Final thoughts
Subnetting is one of those skills that pays off for years. The faster you can interpret IP + mask combinations, the faster you can diagnose outages, design cleaner networks, and prevent configuration errors. Use the calculator above whenever you need a quick and reliable answer.