IPv4 Subnet Mask Calculator Tool
Enter an IPv4 address and either a subnet mask (example: 255.255.255.0) or CIDR prefix (example: /24 or 24).
What this IPv4 subnet mask calculator does
This IPv4 subnet mask calculator helps you quickly break down an IP network into practical values you need for real configuration work: network address, broadcast address, first usable host, last usable host, wildcard mask, and host capacity. Instead of manually converting octets to binary and counting bits, you can get everything in one click.
It accepts both notations used by network engineers and students:
- Dotted decimal subnet mask (like
255.255.255.0) - CIDR prefix length (like
/24)
How subnetting works in plain English
1) The IP address has host and network bits
In IPv4, an address is 32 bits long. The subnet mask tells you which part is the network and which part is the host.
A 1 bit in the mask means “network bit,” and a 0 bit means “host bit.”
2) Network address and broadcast address
- Network address: all host bits set to 0
- Broadcast address: all host bits set to 1
Everything between those two values is typically available for hosts (with special handling for /31 and /32).
3) CIDR makes subnetting cleaner
CIDR notation such as /26 means “26 network bits.” That leaves 6 host bits.
Total addresses are then 2^6 = 64.
Common subnet sizes you will use often
- /24 → 256 total addresses, 254 usable hosts
- /25 → 128 total addresses, 126 usable hosts
- /26 → 64 total addresses, 62 usable hosts
- /27 → 32 total addresses, 30 usable hosts
- /28 → 16 total addresses, 14 usable hosts
- /29 → 8 total addresses, 6 usable hosts
- /30 → 4 total addresses, 2 usable hosts
- /31 → typically 2 usable addresses for point-to-point links
- /32 → a single host route
Practical use cases
LAN planning
If you know a team has about 50 devices, a /26 subnet gives room for growth without wasting too much space.
Firewall and ACL rules
Security rules often rely on network ranges. This tool gives exact network boundaries so you can write cleaner, safer rules.
Troubleshooting
If one host cannot reach another, checking whether both are in the same subnet is often the first diagnostic step.
Frequent subnetting mistakes
- Using non-contiguous subnet masks (invalid in normal CIDR subnetting)
- Forgetting that network and broadcast are reserved for most subnets
- Miscounting usable hosts in very small subnets
- Mixing up wildcard mask and subnet mask
Final thoughts
A good IPv4 subnet mask calculator saves time and prevents address planning errors. Use the calculator above whenever you need quick, reliable subnet details for labs, production networks, or certification study.