FullCalculator

Subnet Mask Calculator

CIDR to Subnet Mask

Convert CIDR prefix length to subnet mask and wildcard mask

Subnet Mask to CIDR

Convert dotted-decimal subnet mask octets to CIDR prefix length

Formula

Subnet Mask = (2^32 - 1) << (32 - CIDR) | Wildcard = NOT(Subnet Mask) | Usable Hosts = 2^(32-CIDR) - 2

Frequently Asked Questions

What is a subnet mask?
A subnet mask is a 32-bit number that divides an IP address into network and host portions. It uses contiguous 1-bits for the network part and 0-bits for the host part. For example, 255.255.255.0 (/24) means 24 bits for the network and 8 bits for hosts.
What is a wildcard mask?
A wildcard mask is the inverse of a subnet mask. Where the subnet mask has 1-bits, the wildcard mask has 0-bits and vice versa. It is commonly used in access control lists (ACLs) on routers. For /24, the wildcard mask is 0.0.0.255.

You may also need