Wildcard Mask Calculator

Convert between wildcard mask, subnet mask and CIDR prefix for ACL and OSPF statements.

What does this calculator do?

A wildcard mask is the bitwise inverse of a subnet mask: a 0-bit means the bit must match, a 1-bit means the bit is free to vary. Cisco IOS access control lists and OSPF network statements are written with wildcard masks rather than subnet masks, which is a frequent source of configuration mistakes. This converter takes any of the three notations — CIDR prefix, subnet mask or wildcard mask — and returns the other two along with the binary mask and the host-bit count. Conversion is exact. Everything is computed in your browser from the values you type. Nothing is looked up on the network — there is no ping, no DNS query, no WHOIS and no geolocation.

Formula

Each octet of the wildcard is 255 minus the corresponding subnet-mask octet.

wildcardMask = 255.255.255.255 − subnetMask
wildcardOctet = 255 − maskOctet
hostBits = number of 1-bits in the wildcard
prefix = 32 − hostBits

How to use it

Select which of the three notations you have; the form shows only that input. Dotted-decimal values must be complete, for example 0.0.0.63. A wildcard mask entered here must invert to a valid contiguous subnet mask — the discontiguous wildcards that some ACL styles allow for odd/even matching are rejected, because they have no CIDR equivalent.

Worked example

Prefix /26 gives the subnet mask 255.255.255.192, binary 11111111.11111111.11111111.11000000. The wildcard is 255.255.255.255 − 255.255.255.192 = 0.0.0.63, and its 6 one-bits match the 6 host bits — so an ACL line reading 192.168.1.0 0.0.0.63 matches the same 64 addresses as 192.168.1.0/26.

Formula version1.0.0
FormulawildcardMask = 255.255.255.255 − subnetMask wildcardOctet = 255 − maskOctet hostBits = number of 1-bits in the wildcard prefix = 32 − hostBits

Frequently asked questions

Is a wildcard mask the same as an inverse mask?

Yes — "wildcard mask" and "inverse mask" are two names for the same value. Both mean the bitwise complement of the subnet mask.

Why do ACLs use 0.0.0.255 instead of 255.255.255.0?

ACL matching asks which bits are allowed to differ, so the free bits are marked with 1s. A /24 has 8 free host bits, which is 0.0.0.255 as a wildcard and 255.255.255.0 as a subnet mask.

What does host 192.168.1.10 mean in an ACL?

It is shorthand for the wildcard 0.0.0.0, which matches that single address exactly — the equivalent of a /32.

Sources

Related calculators

Last updated: 2026-08-10 · v1.0.0 · Report an error