IPv4 Subnet Mask Calculator
Enter an IPv4 address and either a CIDR prefix or a subnet mask. If both are entered, the subnet mask takes priority.
What this online subnet mask calculator does
Subnetting can feel like a lot of mental math when you are planning VLANs, troubleshooting an ACL, or validating static routes. This online subnet mask calculator helps you immediately translate between CIDR notation and dotted-decimal subnet masks, while also showing the practical outputs you need in real work.
Given an IPv4 address and prefix, the tool computes the full network details, including network address, broadcast address, usable host range, wildcard mask, host counts, and binary mask representation. It is designed for students, sysadmins, network engineers, and anyone preparing for certifications like Network+ or CCNA.
How to use the calculator
Step-by-step
- Enter any valid IPv4 address (for example, 10.20.30.99).
- Enter either a CIDR prefix (like /27) or a subnet mask (like 255.255.255.224).
- Click Calculate to generate full subnet details.
- Use Reset to return to default values and clear results.
If you provide both CIDR and mask and they do not match, the calculator prioritizes the subnet mask and alerts you so you can correct the mismatch.
Subnetting fundamentals in plain English
IPv4 address
An IPv4 address is a 32-bit number written as four octets (0–255), such as 192.168.1.130. Part of that address identifies the network, and the rest identifies the host.
Subnet mask and CIDR
A subnet mask (for example, 255.255.255.0) marks which bits belong to the network. CIDR is a compact form of the same thing (for example, /24). A higher CIDR value means more network bits and fewer host bits.
Network and broadcast addresses
The network address is the first address in a subnet, and the broadcast address is the last. In traditional subnets, those two addresses are reserved and not assignable to hosts. The calculator handles special prefixes like /31 and /32 correctly.
Common CIDR prefixes and masks
- /8 = 255.0.0.0
- /16 = 255.255.0.0
- /24 = 255.255.255.0
- /25 = 255.255.255.128
- /26 = 255.255.255.192
- /27 = 255.255.255.224
- /28 = 255.255.255.240
- /29 = 255.255.255.248
- /30 = 255.255.255.252
Why these results matter in real networks
Good subnet design avoids address waste, improves security boundaries, and simplifies route summarization. Before deploying a new segment, you should verify:
- That the host range can accommodate expected growth.
- That gateway and reserved infrastructure addresses are planned.
- That wildcard masks match ACL requirements.
- That no overlap exists with neighboring subnets.
Using a fast calculator like this reduces manual errors and speeds up planning, documentation, and troubleshooting.
Quick example
Suppose you enter 10.20.30.99 with /27. The calculator will show a subnet mask of 255.255.255.224, network 10.20.30.96, broadcast 10.20.30.127, and a usable host range from 10.20.30.97 to 10.20.30.126.
That means this subnet gives you 32 total addresses (30 usable in standard host subnetting), which is a common size for small VLANs.
FAQ
Can I use this for private and public IPv4 addresses?
Yes. The math is the same for both. The calculator also indicates whether your entered IP falls in a private range.
What happens with /31 and /32?
/31 is typically used on point-to-point links and provides two usable endpoints. /32 represents a single host route.
Why must subnet masks be contiguous?
Valid IPv4 subnet masks consist of consecutive 1 bits followed by consecutive 0 bits. Non-contiguous masks are considered invalid in normal CIDR-based networking.
Final thoughts
If you work with routing tables, firewalls, or IPAM documentation, subnet accuracy is non-negotiable. Keep this online subnet mask calculator bookmarked for quick checks and cleaner planning. It is fast, practical, and built to give you the exact network details you need in seconds.