CIDR to Netmask Converter

Enter a CIDR prefix like 24 or a netmask, then pick the direction.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

CIDR notation (Classless Inter-Domain Routing) expresses an IPv4 subnet mask as a prefix length — the number of leading 1-bits in the 32-bit mask — written after a slash, such as /24. A /24 prefix means the first 24 bits are network bits and the remaining 8 are host bits, which translates to the dotted-decimal mask 255.255.255.0; converting in the other direction, a dotted mask is read bit by bit to recover its prefix length. The number of usable host addresses in a subnet is 2^(32−prefix) − 2, subtracting the network address and broadcast address that can’t be assigned to a host.

The wildcard mask — the bitwise inverse of the subnet mask — is used separately in access control lists and routing configurations (notably on Cisco IOS) where matching rules are expressed as “don’t care” bits rather than network/host bits. Network engineers and system administrators move between prefix length, dotted-decimal mask, host count, and wildcard mask constantly when planning subnets, writing firewall rules, or configuring routers; this calculator converts a CIDR prefix (or a netmask) into all of these related values.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators