Subnet Tools

Wildcard Mask Calculator

Convert a subnet mask to a wildcard mask, or a wildcard mask back to a subnet mask.

Worked example

Enter the mask 255.255.255.224 to get the wildcard 0.0.0.31.

In a Cisco ACL, access-list 10 permit 192.168.10.32 0.0.0.31 matches 192.168.10.32 to 192.168.10.63: a 0 bit in the wildcard means "must match", a 1 bit means "any value".

How it works

A wildcard mask is the bitwise inverse of a subnet mask. Every bit flips. Where the subnet mask has a 1 (part of the network portion), the wildcard mask has a 0, and the other way around.

This is the same math used for the wildcard mask shown on the IPv4 Subnet Calculator's results panel. This tool just lets you convert a mask on its own, without needing a full IP address and subnet breakdown.

Learn the theory

FAQ

What is a wildcard mask used for?
Wildcard masks are used mainly in Cisco IOS. Access control lists (ACLs) and OSPF network statements both use a wildcard mask, instead of a subnet mask, to specify which addresses match.
How is a wildcard mask calculated?
It's the bitwise inverse of the subnet mask. Every 1 becomes a 0, and every 0 becomes a 1. For example, the subnet mask 255.255.255.0 inverts to the wildcard mask 0.0.0.255.
Does the conversion work in both directions?
Yes, for wildcard masks made from a subnet mask: inverting one gets you back the original subnet mask. A wildcard with gaps in its bits, which ACLs allow, has no matching subnet mask, and the tool says so.

Related tools