1001Ferramentas
🎭Converters

CIDR to Wildcard Mask Converter

Convert a CIDR mask (/n) into a wildcard mask, the format used in Cisco router ACLs. An essential tool for network administration and configuration.

Wildcard

Netmask and wildcard from a prefix length

A wildcard mask is the subnet mask inverted bit by bit. Where the mask has a 1, the wildcard has a 0, and the other way round. It exists because Cisco gear uses that form in access lists: instead of writing 255.255.255.0, the ACL wants 0.0.0.255. Anyone juggling both formats in the same afternoon eventually swaps one for the other, and the ACL starts permitting a great deal more — or a great deal less — than intended.

Enter just the prefix length, from 0 to 32, and the page returns both forms at once: the subnet mask and the matching wildcard. A /24 gives mask 255.255.255.0 and wildcard 0.0.0.255. A /30, common on point-to-point links, gives 255.255.255.252 and 0.0.0.3. And a /32, which identifies a single host, gives 255.255.255.255 with wildcard 0.0.0.0.

It helps to keep the meanings apart: in a mask, the bits set to 1 mark the fixed part of the address; in a wildcard, the bits set to 1 mark the part that may vary — the bits the device should ignore when matching. Some platforms also accept discontiguous wildcards for odd/even matching, but those do not come out of a CIDR prefix and are not generated here.

Frequently asked questions

Are wildcard and inverse mask the same thing?
For anything derived from a CIDR prefix, yes: the wildcard is the one's complement of the mask. The difference is only where each one goes — IOS expects the wildcard in ACLs and the mask on interface commands, and swapping the two is the classic beginner mistake.
Which wildcard matches a single host?
0.0.0.0, which is the /32. In ACLs this usually appears written as "host 10.1.1.5", which means exactly the same as "10.1.1.5 0.0.0.0". At the other extreme, 255.255.255.255 is the /0 and matches any address, normally written as "any".
Why does /31 show mask 255.255.255.254?
Because only two addresses remain in the block. Historically those would be network and broadcast, leaving no usable host, but RFC 3021 allows /31 on point-to-point links with both addresses assigned to the two ends. That is why /31 shows up on router links while /30 is still common on older equipment.

Related Tools