IPv4 Netmask & CIDR Calculator
Enter an IPv4 address and either a CIDR prefix (like 24) or subnet mask (like 255.255.255.0).
What is a netmask calculator for CIDR?
A netmask calculator converts between CIDR notation (for example, /24) and
traditional subnet mask notation (for example, 255.255.255.0).
It also computes important network details such as network address, broadcast address, wildcard mask,
and usable host range.
If you work with routers, firewalls, cloud VPCs, VLAN planning, or ACL rules, this conversion happens constantly. This page gives you an instant way to check your math and avoid address planning mistakes.
How to use this calculator
- Enter an IPv4 address (example:
10.20.30.40). - Provide either a CIDR prefix (example:
16) or a subnet mask (example:255.255.0.0). - Click Calculate from CIDR or Convert Mask to CIDR.
- Review the calculated network block details and host capacity.
Quick CIDR reference table
| CIDR | Subnet Mask | Total Addresses | Usable Hosts* |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /24 | 255.255.255.0 | 256 | 254 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 (point-to-point) |
| /32 | 255.255.255.255 | 1 | 1 (single host) |
*Traditional usable host count excludes network and broadcast on most subnet sizes.
CIDR and subnetting basics
Why CIDR replaced classful networking
Classful addressing (Class A, B, C) wastes space in modern networks. CIDR lets you assign prefixes of any size, so a network can be exactly as large as needed. This reduces address waste and enables route aggregation.
Binary view of a subnet mask
Every 1 bit in a subnet mask belongs to the network portion; every 0 bit belongs to the host portion.
For example, /24 means 24 network bits and 8 host bits.
- /24 mask in binary:
11111111.11111111.11111111.00000000 - Wildcard (inverse mask):
00000000.00000000.00000000.11111111
Common mistakes this tool helps avoid
- Using a non-contiguous subnet mask (invalid in standard IPv4 subnetting).
- Forgetting that /31 and /32 behave differently than larger subnets.
- Applying the wrong wildcard mask in ACL configurations.
- Assuming every subnet has 254 usable hosts (only true for /24).
Final tip
Keep calculations repeatable: always verify IP, mask, network, broadcast, and usable range together. A good netmask calculator should make that one-click simple—and that’s exactly what this page is built to do.