Wildcard Mask Calculator
Convert subnet masks and CIDR prefixes to Cisco-style wildcard masks, calculate the corresponding network mask, and test whether an IPv4 address matches a wildcard pattern.
Wildcard Matching Test
Enter a base/network address and a wildcard mask. In Cisco-style wildcard logic, 0 = must match and 1 = ignore this bit.
Example: 192.168.10.0 0.0.0.255 matches addresses from 192.168.10.0 through 192.168.10.255.
Wildcard Masks You Should Know
| Subnet Mask | CIDR | Wildcard Mask | Typical use |
|---|---|---|---|
| 255.255.255.0 | /24 | 0.0.0.255 | Match a /24 network |
| 255.255.255.128 | /25 | 0.0.0.127 | Match a /25 subnet |
| 255.255.255.192 | /26 | 0.0.0.63 | Match a /26 subnet |
| 255.255.255.224 | /27 | 0.0.0.31 | Match a /27 subnet |
| 255.255.255.240 | /28 | 0.0.0.15 | Match a /28 subnet |
| 255.255.255.248 | /29 | 0.0.0.7 | Match a /29 subnet |
| 255.255.255.252 | /30 | 0.0.0.3 | Match a /30 subnet |
| 255.255.255.255 | /32 | 0.0.0.0 | Match one exact IP |
| 0.0.0.0 | /0 | 255.255.255.255 | Match any IPv4 address |
Why Cisco Uses Wildcard Masks
A subnet mask describes which bits belong to the network. A wildcard mask is its inverse: 0 bits are significant and must match; 1 bits are ignored.
Example:
Network:
Subnet mask:
Wildcard:
This means the first three octets must match, while the last octet can vary from 0 to 255.
Network:
192.168.10.0Subnet mask:
255.255.255.0Wildcard:
0.0.0.255This means the first three octets must match, while the last octet can vary from 0 to 255.
Common Cisco contexts
- Standard and extended IPv4 ACL entries.
- OSPF network statements on Cisco IOS.
- Other Cisco features that use wildcard-style matching.
Important: wildcard masks are not the same thing as subnet masks. A subnet mask's 1 bits identify the network portion; a wildcard mask's 0 bits identify the bits that must match.
