Network Tools

Subnet mask to binary.

Enter a subnet mask as 255.255.255.0, /24 or binary and see it in binary with its CIDR prefix, wildcard mask and host count. Add an IP address to watch the AND step that finds the network. Runs in your browser.

Advertisement

Input

Dotted decimal, /prefix or prefix number (0 to 32), dotted binary, or 32 bits.
Add one to see the network address worked out bit by bit.

Result

Enter a value, then press Calculate.

How a subnet mask works in binary

Common masks

PrefixDotted decimalBinaryAddressesUsable
/8255.0.0.011111111.00000000.00000000.000000001677721616777214
/16255.255.0.011111111.11111111.00000000.000000006553665534
/24255.255.255.011111111.11111111.11111111.00000000256254
/25255.255.255.12811111111.11111111.11111111.10000000128126
/26255.255.255.19211111111.11111111.11111111.110000006462
/27255.255.255.22411111111.11111111.11111111.111000003230
/28255.255.255.24011111111.11111111.11111111.111100001614
/29255.255.255.24811111111.11111111.11111111.1111100086
/30255.255.255.25211111111.11111111.11111111.1111110042

Example: 192.168.1.130 with /26 (255.255.255.192) gives network 192.168.1.128 and broadcast 192.168.1.191. For a full subnet plan use the IP Subnet / CIDR Calculator; for single addresses see IP Address to Binary and Binary to IP Address; for numbers in general the Binary Converter.

If you enter a wildcard mask such as 0.0.0.255, the tool recognises it and shows the subnet mask it corresponds to. Everything runs in your browser.

FAQ

What is 255.255.255.0 in binary?

11111111.11111111.11111111.00000000. That is 24 ones followed by 8 zeros, so the CIDR prefix is /24.

How do I convert a subnet mask to CIDR?

Convert each octet to binary and count the 1 bits. 255.255.255.192 is 11111111.11111111.11111111.11000000, which has 26 ones, so it is /26.

What is a wildcard mask?

The subnet mask with every bit flipped. For 255.255.255.0 the wildcard mask is 0.0.0.255. It is used where a device matches addresses by the bits that may vary.

Why is 255.0.255.0 rejected as a CIDR mask?

CIDR masks must have all their 1 bits together on the left (RFC 4632). A mask with 1s after a 0 cannot be written as a /prefix.

How many hosts fit in a /24, /30, /31 and /32?

A /24 has 256 addresses and 254 usable hosts, a /30 has 4 addresses and 2 usable hosts, a /31 has 2 addresses that are both usable on a point-to-point link (RFC 3021), and a /32 is one address.

Sources

Sources retrieved October 2026.

Advertisement
Advertisement