Wildcard Mask
Paste a mask (255.255.255.0), a CIDR (/24) or a wildcard (0.0.0.255) — it is auto-detected — and get the wildcard, the mask, the CIDR and the binary of the 32 bits. With an optional network it builds the Cisco ACL and OSPF examples. Nothing is sent to any server.
Binary of the 32 bits
bits set to 1 bits set to 0
Configuration examples
Type a network above to use it in the commands.
What the wildcard is · how it is calculated
1. The wildcard (or inverse
mask) is the bitwise NOT of the network mask: per octet,
255 − octet.
2. A 0 bit in the wildcard
means "must match"; a 1 bit means
"don't care". It is the opposite of the mask.
3. Cisco uses the wildcard in
ACLs and in OSPF
(network <network> <wildcard> area 0).
4. A valid mask has the 1s
followed by the 0s (contiguous); the CIDR
(/n) is the number of bits set to 1. A non-contiguous
wildcard is legal in an ACL but does not map to a CIDR.
Runs locally in your browser · no sign-up · nothing leaves your browser.
How it works
The tool converts between the three ways of writing an IPv4 mask: dotted-decimal mask (255.255.255.0), CIDR prefix (/24) and wildcard or inverse mask (0.0.0.255). You paste any of the three and it autodetects the format, showing the other two along with the full 32-bit binary of both the mask and the wildcard. If you also provide a network address, it generates ready-to-copy example commands: a standard Cisco ACL and the OSPF network statement.
The math is a bitwise NOT: the wildcard is the complement of the mask, which per octet equals 255 − octet. In a wildcard a 0 bit means «must match» and a 1 bit means «do not care», exactly the opposite of the mask. The tool validates that the mask is contiguous (all the 1s followed by all the 0s, the condition for a CIDR prefix to exist) and, if you paste a non-contiguous wildcard, it warns that it is legal in an ACL but does not map to any /n.
Example: the wildcard of a /26 for an ACL
- Input
/26: the mask has 26 bits set to 1, that is 255.255.255.192. - Wildcard per octet:
255−255, 255−255, 255−255, 255−192→ 0.0.0.63. - With network 192.168.1.0 the tool generates
access-list 10 permit 192.168.1.0 0.0.0.63andnetwork 192.168.1.0 0.0.0.63 area 0.