Wildcard Mask Calculator
Wildcard Mask Calculator. Enter a Subnet Mask and click Convert to Wildcard in this wildcard mask calculator to get the wildcard mask for Cisco ACLs.
Subnet Mask to Wildcard
Wildcard to Subnet Mask
Binary Representation
Cisco Command Examples
Common Wildcard Masks
| CIDR | Subnet Mask | Wildcard Mask | Hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,214 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,534 |
| /24 | 255.255.255.0 | 0.0.0.255 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 |
Enter a subnet mask or wildcard mask to instantly convert between the two formats for Cisco ACL and OSPF configuration. Get the inverse mask, matching IP range, and access list notation — essential for writing Cisco IOS access control lists, OSPF network statements, and router filter rules.
Type any subnet mask, wildcard mask, or CIDR value into the Wildcard Mask Calculator above and you'll instantly see all three notations side by side, along with the total IPs and usable hosts for that block. This is core Internet Protocol math — the kind of IP networking every network engineer eventually does by hand, whether you're studying for the CCNA or CompTIA Network+ exam, or writing an ACL and OSPF network statement at 2 a.m. This guide walks through the conversion formula, shows a worked example, and gives you copy-ready values for the ACL and protocol configurations you'll actually type into a router.
How the Wildcard Mask Calculator Works
Every wildcard mask calculator does the same job: it takes a mask or a value in CIDR notation you already have and flips it into the inverse that Cisco routing protocols expect. Enter a dotted-decimal mask like 255.255.255.0, CIDR notation like /24, or an existing inverted value like 0.0.0.255, and it normalizes all three formats plus the binary breakdowns underneath. It's built on the same logic as any ip calculator you've used for subnetting — useful whether you're troubleshooting a misconfigured ACL, handling network administration on a production router, or double-checking your IP addressing before you commit a change to a live production network.
- A dotted-decimal subnet mask, like 255.255.255.0
- A CIDR value, like /24
- An existing inverted value, like 0.0.0.255
Reading the Full Reference Table
The reference table below covers the CIDR prefixes you'll run into most often, from a full /8 down to a single-host /32. Every row includes both notations so you never have to guess which direction a value needs flipping. Bookmark it if you regularly convert between dotted-decimal masks and CIDR notation — it saves you from re-deriving the same values every time you manage multiple subnets.
| CIDR Notation | Subnet Mask | Wildcard Mask | Total IPs | Usable Hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Wildcard Mask vs. Subnet Mask: What's the Difference?
A subnet mask and a wildcard mask describe the exact same network boundary, just read in opposite directions. Mixing them up is one of the most common reasons an ACL matches the wrong addresses, so it's worth being precise about which one belongs in which command.
Subnet Mask Basics: Network Portion vs Host Portion
A subnet mask uses 1 bits to mark the network portion of an address — the part that must match exactly — and 0 bits for the host portion, which varies from device to device. You'll see this notation in operating-system network configuration, DHCP scopes, and routing tables. 255.255.255.0 is a /24: the first three octets identify the network, and the last one is left for host assignment. Subnetting is simply the practice of carving one large network into several smaller subnets this way, and each of those subnets is also called a subnetwork.
Wildcard Mask Basics: Don't-Care Bits Explained
A wildcard mask inverts that logic across the same 32 bits. Here, a 0 bit means "must match exactly" and a 1 bit means "don't care" — any value is acceptable in that position. Wildcard masks show up in Cisco ACLs, OSPF and EIGRP network statements, and BGP network advertisements rather than in general OS configuration. Most of the values you'll write are contiguous, mirroring standard CIDR notation, but Cisco IOS technically permits a non-contiguous pattern too (for example, matching only even-numbered addresses) — valid, but rarely used and generally discouraged.
The Wildcard Mask Conversion Formula
You don't need a calculator to convert a subnet mask by hand — the formula is a simple subtraction across all four positions:
$$255.255.255.255 - \text{Mask} = \text{Wildcard}$$
Worked Example: Subtracting From 255
Take 255.255.255.0 and subtract each number from 255 in turn: \(255 - 255 = 0\), \(255 - 255 = 0\), \(255 - 255 = 0\), and \(255 - 0 = 255\). That gives you 0.0.0.255, exactly what a /24 network resolves to. The same logic holds no matter the prefix length: flip every bit of each number and convert back — the calculator above automates that bitwise inverse so you don't have to do the decimal to binary conversion by hand for every subnet you manage.
Using Wildcard Masks in Cisco ACLs and Interior Gateway Protocols
These values show up constantly once you start writing Cisco IOS configuration, and knowing the common ones by heart will save you real time in the field.
Cisco ACL Wildcard Mask Examples
A Cisco ACL entry pairs a network address with an inverted value to define which addresses a permit or deny line applies to. The table below covers the ones you'll reuse most in day-to-day network engineering:
| Use Case | CIDR Notation | Wildcard | Cisco Command |
|---|---|---|---|
| Single host | /32 | 0.0.0.0 | permit host 10.0.0.1 |
| Point-to-point link | /30 | 0.0.0.3 | permit 10.0.0.0 0.0.0.3 |
| Small subnet | /24 | 0.0.0.255 | permit 192.168.1.0 0.0.0.255 |
| Class B network | /16 | 0.0.255.255 | permit 172.16.0.0 0.0.255.255 |
| Any host | /0 | 255.255.255.255 | permit any |
Notice the extremes: 0.0.0.0 matches exactly one address, while 255.255.255.255 paired with permit any matches every address on the network. A frequent mistake is typing the subnet mask directly into an ACL line instead of its inverse — the router will accept the command syntactically but silently match the wrong set of addresses, which is a hard bug to spot during a live troubleshooting session. Running the value through the calculator above first removes that risk entirely.
Standard ACLs vs Extended ACLs
Beyond simple ACLs, the same inverted notation appears in OSPF and EIGRP network statements — both are routing protocols that advertise which interfaces participate in a routing process, and both expect this syntax instead of a conventional subnet mask. A typical router ospf configuration block pairs a network address with the inverted value the same way an ACL does. Standard ACLs filter on source address alone using a single value, while extended adds protocol, destination, and port matching — but the underlying math is identical in both. Access control lists, sometimes just called access lists, and BGP advertisements round out the main places you'll use this notation instead of a subnet mask.
- Standard ACLs — filter by source address only, one wildcard value per line
- Extended — adds protocol, destination address, and port matching
- Interior gateway protocols — apply the same wildcard-value pairing under the router configuration
IP Subnet Calculator Reference: Network Class, Broadcast, and Usable Hosts
An ip subnet calculator and this tool are really two views of the same underlying math, so it helps to see CIDR notation in the context of a broader ipv4 subnet calculator reference. Every ip subnet calculator, including this one, needs the same three inputs: a network class or prefix length, an IP address, and a mask.
Network Class A, B, and C Usable Hosts
Historic IPv4 addressing grouped networks into classes by their leading bits. A Class A network uses the first 8 bits as the network identifier (up to 16,777,214 usable hosts), Class B uses the first 16 bits (65,534 usable), and Class C uses the first 24 bits (254 usable). Class D addresses are reserved for multicasting, and Class E is set aside for experimental and future use — neither carries a conventional wildcard value. These allocations predate CIDR and modern network design, but the class boundaries still show up in default subnet mask assumptions on older equipment.
- Class A — /8 in CIDR notation, 255.0.0.0, up to 16,777,214 usable addresses
- Class B — /16, 255.255.0.0, up to 65,534 usable addresses
- Class C — /24, 255.255.255.0, up to 254 usable addresses
- Class D — reserved for multicast, no host allocation
- Class E — reserved for experimental and future use
Octet Math and Broadcast Address
Every mask is really just 32 bits arranged as four octets underneath the dotted-decimal notation you type — a binary subnet mask of 11111111.11111111.11111111.00000000 is the same /24 network as 255.255.255.0, or ff.ff.ff.00 in hexadecimal. Getting comfortable with that bit-level layer makes every other conversion on this page feel mechanical rather than mysterious. Two addresses worth memorizing for any given block: the network address is the lowest value in the range and identifies the subnet itself rather than a host, and the broadcast address is the highest value, reserved for sending data to every device on that subnet at once. Between those two boundaries sits the usable host IP range your devices can actually be assigned, and the full IP address range for the block spans from the network address straight through to the broadcast address.
Related Network Tools
Explore these related tools for subnet calculation and IP address management.
Additional networking calculators for IP address planning and network analysis.
Comments & Feedback
Share your experience or ask questions about this tool