IPv4 Netmask Calculator
Enter an IPv4 address plus either a CIDR prefix or subnet mask to calculate network details instantly.
Tip: If you enter both CIDR and mask, they must match (for example, /24 and 255.255.255.0).
What is a netmask?
A netmask (also called a subnet mask) defines which part of an IPv4 address identifies the network and which part identifies hosts on that network. It works together with the IP address to determine critical values such as the network address, broadcast address, and usable host range.
In modern networking, we usually represent the mask with CIDR notation, such as /24.
This means the first 24 bits are network bits and the remaining 8 bits are host bits.
Subnet mask vs CIDR prefix
These two formats express the same thing:
255.255.255.0is equivalent to/24255.255.0.0is equivalent to/16255.255.255.252is equivalent to/30
A netmask calculator helps you convert and verify these formats while avoiding manual binary math mistakes.
How this calculator netmask tool works
Once you enter your IP and prefix/mask, the calculator applies bitwise logic:
- Network Address = IP address AND subnet mask
- Broadcast Address = Network address OR wildcard mask
- Wildcard Mask = inverse of subnet mask
- Usable Host Range = addresses between network and broadcast (with special handling for /31 and /32)
Special prefixes you should know
- /32: exactly one address (single-host route)
- /31: two addresses, commonly used on point-to-point links
- /24: one of the most common LAN subnet sizes
Common CIDR blocks and host counts
/30→ 4 total addresses, typically 2 usable hosts/29→ 8 total addresses, 6 usable hosts/28→ 16 total addresses, 14 usable hosts/27→ 32 total addresses, 30 usable hosts/26→ 64 total addresses, 62 usable hosts/25→ 128 total addresses, 126 usable hosts/24→ 256 total addresses, 254 usable hosts
Practical example
Input
IP address: 192.168.1.130
Prefix: /24
Output summary
- Subnet mask:
255.255.255.0 - Network address:
192.168.1.0 - Broadcast address:
192.168.1.255 - Usable host range:
192.168.1.1 - 192.168.1.254 - Total addresses: 256
- Usable hosts: 254
This is exactly the kind of output network engineers need when configuring routers, firewalls, VLANs, DHCP scopes, and access control lists.
Common mistakes to avoid
- Using a non-contiguous subnet mask such as
255.0.255.0(invalid) - Confusing network address with default gateway
- Forgetting that usable hosts are not always
total - 2for /31 and /32 - Entering an IP outside the valid IPv4 range (0–255 per octet)
Why a calculator is better than manual subnetting
Manual subnetting is a great skill, but in real operations speed and accuracy matter. A good netmask calculator gives consistent results quickly, helps validate planning decisions, and reduces costly configuration errors.
Keep this tool bookmarked for network design sessions, server deployment checklists, and troubleshooting workflows.