Reverse Subnet Mask (Wildcard) Calculator
Enter either a subnet mask or a CIDR prefix. The calculator returns the reverse subnet mask (wildcard mask), plus useful subnet details.
Tip: Reverse mask = 255.255.255.255 - subnet mask. For /24, reverse mask is 0.0.0.255.
What Is a Reverse Subnet Mask?
A reverse subnet mask is more commonly called a wildcard mask. It is the bitwise inverse of a standard subnet mask. In simple terms, every 255 becomes 0, every 0 becomes 255, and values in between are inverted octet by octet.
For example:
- Subnet mask:
255.255.255.0 - Reverse mask / wildcard:
0.0.0.255
Network engineers often use wildcard masks in ACL rules and routing configurations, especially on Cisco-style devices.
Why Use a Reverse Subnet Mask Calculator?
Even experienced admins can make mistakes when converting masks under pressure. A calculator helps you quickly convert between subnet mask, CIDR notation, and wildcard mask without manual binary math each time.
- Reduces configuration errors in firewalls and ACLs
- Speeds up troubleshooting and network documentation
- Helps confirm host counts and address ranges
- Useful for students preparing for CCNA/Network+ style exams
How the Calculation Works
Method 1: Octet-by-octet subtraction
Take each subnet mask octet and subtract it from 255:
- 255 - 255 = 0
- 255 - 255 = 0
- 255 - 255 = 0
- 255 - 0 = 255
So 255.255.255.0 becomes 0.0.0.255.
Method 2: Binary inversion
Subnet masks are continuous 1s followed by 0s in binary. A wildcard mask flips those bits:
- Subnet bits (network bits) become 0
- Host bits become 1
This is why wildcard masks represent which bits can vary when matching addresses.
Common Subnet to Reverse Mask Conversions
| CIDR | Subnet Mask | Reverse (Wildcard) Mask |
|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 |
| /16 | 255.255.0.0 | 0.0.255.255 |
| /24 | 255.255.255.0 | 0.0.0.255 |
| /25 | 255.255.255.128 | 0.0.0.127 |
| /26 | 255.255.255.192 | 0.0.0.63 |
| /27 | 255.255.255.224 | 0.0.0.31 |
| /28 | 255.255.255.240 | 0.0.0.15 |
| /29 | 255.255.255.248 | 0.0.0.7 |
| /30 | 255.255.255.252 | 0.0.0.3 |
| /31 | 255.255.255.254 | 0.0.0.1 |
| /32 | 255.255.255.255 | 0.0.0.0 |
Where Wildcard Masks Are Used
Access Control Lists (ACLs)
In many router ACL syntaxes, wildcard masks define which host bits can vary. For example, to match any address in a /24 network, you typically pair the network address with wildcard 0.0.0.255.
Routing Protocol Statements
Some routing configurations also use wildcard logic when selecting interfaces or networks to advertise.
Policy Matching and Filtering
Wildcard masks are compact and powerful when writing rule-based matching logic in legacy and enterprise environments.
Input Validation Notes
The calculator validates that dotted masks are contiguous subnet masks. That means masks such as 255.0.255.0 are rejected because subnet mask bits must be continuous ones followed by zeros.
- Valid:
255.255.224.0 - Invalid:
255.224.255.0
Quick FAQ
Is reverse subnet mask the same as wildcard mask?
Yes. In networking practice, those terms are generally used interchangeably.
Can I calculate reverse mask from CIDR directly?
Absolutely. Convert CIDR to subnet mask first, then invert the mask.
What about /31 and /32 host counts?
/31 is typically used for point-to-point links and can support two endpoints. /32 identifies a single host address.
Final Thoughts
A reverse subnet mask calculator is a small tool that prevents big configuration mistakes. Whether you are writing ACL rules, documenting networks, or preparing for certification exams, fast and accurate mask conversion is essential.