UTILS.
Private by default
0.0

Wildcard Mask Converter

Convert freely between CIDR prefix, subnet mask and wildcard mask.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

Enter any one of a CIDR prefix, a subnet mask, or a wildcard mask.

About this tool

Wildcard Mask Converter changes between the three ways of writing the same IPv4 subnet size: a CIDR prefix such as /24, a subnet mask such as 255.255.255.0 and a wildcard mask such as 0.0.0.255. Enter any one of them and all three are shown.

A wildcard mask is the bitwise opposite of the subnet mask, so 0 bits must match and 1 bits are ignored. It is used in Cisco-style access lists and OSPF network statements. The tool accepts a prefix with or without the slash (/24 or 24), a dotted mask, or a dotted wildcard. For dotted input it first tries to read it as a subnet mask, then as a wildcard. That means 0.0.0.0 is read as the mask for /0 and 255.255.255.255 as the mask for /32, even though in an access list they usually mean a wildcard for one host and for all addresses respectively.

Only contiguous masks are valid: 255.0.255.0 or a wildcard like 0.255.0.255 is reported as invalid, as is a prefix above 32. The converter handles IPv4 only and does not take an address, so for network and broadcast values use a subnet calculator. Everything runs locally in your browser.

Frequently asked questions

What input formats are accepted?
A CIDR prefix with or without a slash (/24 or 24), a dotted subnet mask such as 255.255.255.0, or a dotted wildcard mask such as 0.0.0.255. The input type is detected automatically.
What is a wildcard mask used for?
It tells devices such as routers which address bits to ignore when matching, in Cisco access lists and OSPF network statements. A 0 bit must match and a 1 bit is ignored.
Why is 0.0.0.0 or 255.255.255.255 shown differently than I expected?
They are valid as both masks and wildcards, and the tool reads dotted input as a subnet mask first. So 0.0.0.0 gives /0 and 255.255.255.255 gives /32. Enter the prefix directly to avoid ambiguity.
Are non-contiguous masks supported?
No. Only masks made of consecutive 1s followed by 0s correspond to a CIDR prefix, so anything else is reported as invalid.

More tools