IPv4 Wildcard Mask Calculator

IP Address:

Wildcard Mask:




What is a Wildcard Mask?

A wildcard mask is a string of binary digits used in conjunction with IP addresses or subnet masks to specify a range of addresses for network routing or access control purposes. It acts as a filter, indicating which portions of an IP address should be considered when matching addresses. Wildcard masks are commonly utilized in network configurations to define subsets of IP addresses for routing or filtering purposes.

How Does a Wildcard Mask Work?

A wildcard mask works by selectively "masking off" certain portions of an IP address or subnet mask to create a pattern for matching multiple addresses. In essence, it defines which bits in an IP address or subnet mask are significant for matching and which are ignored. When a packet is processed by a router or firewall, the device applies the wildcard mask to the packet's destination address to determine if it matches any predefined criteria. If the address matches the pattern specified by the wildcard mask, the device applies the associated routing or filtering rules.

Where Can Wildcard Masks Be Used?

Wildcard masks find applications in various networking scenarios, including but not limited to:
1. Access Control Lists (ACLs)
Used in routers and firewalls to permit or deny traffic based on IP addresses or ranges defined by wildcard masks.
2. Routing Protocols
Used to specify which routes should be advertised or accepted by a router based on destination IP addresses or ranges.
3. IP summarization
It is a technique with which one can reduce the number of routes in a routing table by aggregating them into a single route with a common prefix. Wildcard masks can be used to specify which bits of the prefix are variable and which are fixed.
4. Network Address Translation (NAT)
It is a process that assists in changing the source or destination IP address of a packet as it passes through a device. It is used for various purposes, such as conserving IP addresses, hiding internal network topology, etc.
One can use these masks in order to specify the IP address range that one wants to translate.
5. Virtual Private Networks (VPNs)
Employed to define which traffic should be encrypted and sent over a VPN tunnel based on source or destination IP addresses.
6. Quality of Service (QoS)
Utilized to classify and prioritize network traffic based on IP addresses or ranges, ensuring critical data receives preferential treatment.

Example 1: Matching a Specific Host

In network setups, specifying device access is crucial. Let's say your network is based on the address 192.168.1.0, and you want devices within the range of 192.168.1.1 to 192.168.1.255 to connect. This is where a wildcard mask comes in handy, acting as a selective filter.

For this scenario, our wildcard mask is 0.0.0.255. What does that signify? Think of it as directing attention solely to the last part of the IP address, which pinpoints individual devices
With this wildcard mask, any device with an IP address ending between 1 and 255 gains entry to your network. This balancing act between control and adaptability ensures seamless connectivity, accommodating a diverse array of devices.

Example 2: Matching an Entire Subnet

In networking, efficiently managing large chunks of IP addresses is vital. Consider a network with a base address of 10.0.0.0 and a subnet mask of 255.0.0.0, indicating that the first octet represents the network portion. By employing a wildcard mask of 0.255.255.255, we permit variability in the last three octets while keeping the first octet constant.
This approach ensures that any device within the 10.0.0.0 subnet, regardless of its specific IP address in the range 10.0.0.1 to 10.255.255.254, can seamlessly communicate within the network. This flexibility facilitates efficient network management and promotes smooth connectivity for all devices within the specified subnet.

List of Wildcard Masks

Slash Netmask Wildcard mask
/32 255.255.255.255 0.0.0.0
/31 255.255.255.254 0.0.0.1
/30 255.255.255.252 0.0.0.3
/29 255.255.255.248 0.0.0.7
/28 255.255.255.240 0.0.0.15
/27 255.255.255.224 0.0.0.31
/26 255.255.255.192 0.0.0.63
/25 255.255.255.128 0.0.0.127
/24 255.255.255.0 0.0.0.255
/23 255.255.254.0 0.0.1.255
/22 255.255.252.0 0.0.3.255
/21 255.255.248.0 0.0.7.255
/20 255.255.240.0 0.0.15.255
/19 255.255.224.0 0.0.31.255
/18 255.255.192.0 0.0.63.255
/17 255.255.128.0 0.0.127.255
/16 255.255.0.0 0.0.255.255
/15 255.254.0.0 0.1.255.255
/14 255.252.0.0 0.3.255.255
/13 255.248.0.0 0.7.255.255
/12 255.240.0.0 0.15.255.255
/11 255.224.0.0 0.31.255.255
/10 255.192.0.0 0.63.255.255
/9 255.128.0.0 0.127.255.255
/8 255.0.0.0 0.255.255.255
/7 254.0.0.0 1.255.255.255
/6 252.0.0.0 3.255.255.255
/5 248.0.0.0 7.255.255.255
/4 240.0.0.0 15.255.255.255
/3 224.0.0.0 31.255.255.255
/2 192.0.0.0 63.255.255.255
/1 128.0.0.0 127.255.255.255
/0 0.0.0.0 255.255.255.255