CIDR to Subnet Mask Converter

CIDR to Subnet Mask Converter

Turn an IP/CIDR notation like 10.0.0.0/16 into its subnet mask, wildcard mask, network and broadcast addresses, and usable host count.

Network

Format: an IPv4 address, a slash, and a prefix length from 0-32 (e.g. 10.0.0.0/16).

Mask

Range

How to use this tool

  1. Enter an IPv4 address and CIDR prefix separated by a slash, e.g. 192.168.1.0/24.
  2. The mask panel shows the subnet mask in dotted-decimal form and its wildcard-mask complement, used by some router ACL syntaxes.
  3. The range panel shows the network address (all host bits zero), broadcast address (all host bits one), and usable host count.
  4. Usable hosts subtracts the network and broadcast addresses from the total, except for /31 and /32 which use RFC 3021/host-route conventions instead.

A CIDR prefix (the /24 in 192.168.1.0/24) is a compact way to say how many of an IPv4 address’s 32 bits are the fixed network portion, with the rest available for hosts. A /24 fixes the first 24 bits, leaving 8 bits — 256 addresses — for the network. That single number determines the subnet mask, the size of the address range, and how many actual devices can be addressed inside it.

The subnet mask and wildcard mask are two ways of expressing the same boundary. The subnet mask marks network bits with 1s and host bits with 0s in dotted-decimal form; the wildcard mask is its bitwise complement, used by some router platforms (notably Cisco ACLs) where the convention is inverted. Both describe the identical split of network versus host bits.

Network and broadcast addresses are the two addresses in every subnet that can’t be assigned to a device: the network address (all host bits zero) identifies the subnet itself, and the broadcast address (all host bits one) is reserved for sending to every host on it. That’s why usable host count is the block size minus two for most prefixes — except /31, which RFC 3021 defines as a point-to-point link with no network/broadcast reserved, and /32, a single host route.

Frequently asked questions

Why is the usable host count 2 less than the block size?

Because the first address in any subnet (all host bits zero) is the network address and the last (all host bits one) is the broadcast address — neither can be assigned to a device. A /24 has 256 total addresses but 254 usable hosts.

What’s the difference between a subnet mask and a wildcard mask?

They’re bitwise complements of each other. A subnet mask marks network bits with 1s (255.255.255.0 for a /24); a wildcard mask marks the same boundary with 0s for network bits (0.0.0.255 for the same /24). Wildcard masks are mainly used in Cisco ACL and OSPF configuration syntax.

Why don’t /31 and /32 subtract 2 for usable hosts?

RFC 3021 defines /31 specifically for point-to-point links, where both addresses in the 2-address block are usable as the two link endpoints with no network or broadcast address reserved. A /32 is a single address — a host route — so it has exactly one usable address, itself.

Does this tool support IPv6?

No, this converter is IPv4-specific. IPv6 subnetting uses the same CIDR notation concept but with 128-bit addresses and different conventions around host counts.