wildcard mask calculator

Wildcard Mask Calculator

A wildcard mask is the bitwise inverse of a subnet mask. Use the prefix control to calculate both representations side by side and understand which bits must match.

wildcard mask calculatorCIDR to wildcard masksubnet mask to wildcard maskinverse mask calculator
IPv4 / VISUAL ENGINE LOCAL COMPUTE
IP addressVALID
Network / host boundary24 : 8
/0drag the boundary/32
1234567891011121314151617181920212223242526272829303132
Network bitsHost bits
256TOTAL ADDRESSES
192.168.1.0/24
Network address192.168.1.0
Broadcast address192.168.1.255
Usable host range192.168.1.1 — 192.168.1.254
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Usable hosts254

Subnet masks vs wildcard masks

Where a subnet mask uses one-bits to identify the network, a wildcard mask flips every bit. Therefore 255.255.255.0 becomes 0.0.0.255.

Wildcard masks appear in networking workflows such as access-control lists and some routing configurations. A /30 corresponds to subnet mask 255.255.255.252 and wildcard mask 0.0.0.3.

How to calculate a wildcard mask

Subtract each subnet-mask octet from 255. If the subnet mask is 255.255.255.192, the wildcard mask is 0.0.0.63. At the bit level, every 1 becomes 0 and every 0 becomes 1.

Wildcard interpretation

In common ACL matching semantics, a wildcard bit of 0 means the corresponding address bit must match, while 1 means that bit may vary. That makes wildcard masks useful for describing groups of addresses.

Common conversions

/24 maps to 0.0.0.255, /26 to 0.0.0.63, /28 to 0.0.0.15 and /30 to 0.0.0.3. The tool displays the normal subnet mask beside the wildcard mask so the inverse relationship is obvious.

What this calculator shows

The result panel reports the canonical network address, broadcast address, first and last conventional usable addresses, dotted-decimal subnet mask, wildcard mask, total IPv4 address count and usable-host count. The live 32-bit boundary updates with the CIDR prefix, so the relationship between prefix length, block size and address capacity is visible instead of hidden behind a static table.

How to read the result correctly

The calculator normalizes the IP address you enter to the network block that contains it. That means an input such as 192.168.1.42/24 correctly resolves to network 192.168.1.0/24. For prefixes /0 through /30, conventional IPv4 subnetting reserves the first address as the network identifier and the final address as broadcast. /31 and /32 have different practical semantics, so their address counts should not be interpreted with the ordinary “subtract two” rule.

Related subnet tools

You can also use the subnetting cheat sheet for a complete IPv4 prefix reference, browse individual CIDR prefix pages, try the IPv6 subnet calculator, or return to the main visual subnet calculator.

Frequently asked questions

What is a wildcard mask?

A wildcard mask is the bitwise inverse of a subnet mask and is commonly used in network matching rules.

What is the wildcard mask for /24?

The wildcard mask for /24 is 0.0.0.255.

How do I convert subnet mask to wildcard mask?

Subtract each subnet-mask octet from 255.