Subnet Mask Calculator

Convert between CIDR notation and subnet masks, calculate network and broadcast addresses, and determine usable host count.

Frequently Asked Questions

What is the difference between a subnet mask and a CIDR prefix?

They express the same thing in different formats. /24 is a count of network bits; 255.255.255.0 is the same information as a 32-bit dotted-decimal number. CIDR is more compact and modern.

What is a valid subnet mask?

A valid subnet mask is a contiguous block of 1s followed by 0s: e.g., 255.255.255.0 (/24). A non-contiguous value like 255.0.255.0 is invalid as a subnet mask.

Why does /31 have 2 usable hosts but /30 also has only 2?

/30 has 4 total addresses (2 usable + network + broadcast). /31 has 2 total and per RFC 3021 both are usable since no network/broadcast is reserved on point-to-point links.

Can I use 0.0.0.0/0 in this calculator?

Yes. /0 has 4,294,967,296 total addresses. It represents the default route matching any IPv4 address, used in routing tables to represent the entire internet.

Important Disclaimer: Estimates for informational purposes only.

This calculator provides estimates for informational purposes only. Results are based on assumptions and may not reflect actual outcomes. Consult qualified professionals in relevant fields before making important decisions based on these results.