Skip to main content

Subnet Mask Converter

Convert between subnet mask, CIDR prefix length, and wildcard mask instantly.

/

Binary Representation

11111111.11111111.11111111.00000000

Total Addresses

256

Usable Hosts

254

Quick Reference

PrefixMaskWildcardHosts
/8255.0.0.00.255.255.25516,777,214
/16255.255.0.00.0.255.25565,534
/24255.255.255.00.0.0.255254
/25255.255.255.1280.0.0.127126
/26255.255.255.1920.0.0.6362
/27255.255.255.2240.0.0.3130
/28255.255.255.2400.0.0.1514
/29255.255.255.2480.0.0.76
/30255.255.255.2520.0.0.32

About Subnet Masks

A subnet mask is a 32-bit number that divides an IP address into two parts: the network portion and the host portion. The network bits are set to 1 and the host bits are set to 0. For example, a /24 subnet mask (255.255.255.0) means the first 24 bits identify the network and the remaining 8 bits identify individual hosts.

CIDR (Classless Inter-Domain Routing) notation uses a slash followed by the number of network bits, such as /24 or /16. This replaced the old classful system (Class A, B, C) and allows flexible allocation of IP address space. A wildcard mask is the bitwise inverse of the subnet mask, commonly used in Cisco IOS access control lists and OSPF area configurations.

This converter lets you enter any format and instantly see the equivalent subnet mask, CIDR prefix, wildcard mask, binary representation, and host counts. The quick-reference table below covers the most commonly used subnet sizes for network planning.

Frequently Asked Questions

What is a subnet mask?

A subnet mask is a 32-bit number that separates the network portion of an IPv4 address from the host portion. The network bits are contiguous 1s from the left, and the host bits are 0s. For example, 255.255.255.0 means the first 24 bits are the network and the last 8 bits identify individual hosts.

What is CIDR prefix length?

CIDR (Classless Inter-Domain Routing) prefix length is a shorthand notation that counts the number of leading 1-bits in a subnet mask. It's written as a slash followed by a number, such as /24. A /24 prefix is equivalent to the subnet mask 255.255.255.0 and allows 256 total addresses (254 usable hosts).

What is a wildcard mask?

A wildcard mask is the bitwise inverse of a subnet mask. Where the subnet mask has 1s, the wildcard has 0s, and vice versa. For example, the wildcard for /24 (255.255.255.0) is 0.0.0.255. Wildcard masks are used in Cisco IOS access control lists (ACLs) and OSPF area configurations to specify which bits should be matched.

What is the most common subnet mask?

The most common subnet mask is 255.255.255.0 (/24), which provides 256 addresses and 254 usable hosts. It's the standard for small office and home networks. Other common masks include /16 (255.255.0.0) for larger networks with 65,534 usable hosts, and /8 (255.0.0.0) for very large networks with over 16 million hosts.

How many hosts does each subnet size support?

The number of usable hosts is 2^(32-prefix) minus 2 (for the network and broadcast addresses). Common examples: /24 = 254 hosts, /25 = 126 hosts, /26 = 62 hosts, /27 = 30 hosts, /28 = 14 hosts, /29 = 6 hosts, /30 = 2 hosts (point-to-point links). /31 subnets provide 2 hosts with no broadcast (RFC 3021), and /32 is a single host route.