calculator subnet mask

Subnet Mask Calculator

Enter a CIDR prefix or a subnet mask. If both are provided, CIDR is used.

A subnet mask calculator helps you quickly break down IPv4 network information from an IP address and prefix length. Instead of doing binary math by hand, you can instantly get the subnet mask, network address, broadcast address, wildcard mask, and usable host range.

What is a subnet mask?

A subnet mask is a 32-bit value that separates the network portion of an IPv4 address from the host portion. It works alongside CIDR notation (like /24) to define how large or small a subnet is.

  • /24 means 24 bits are for the network, 8 bits are for hosts.
  • 255.255.255.0 is the dotted-decimal form of /24.
  • The more network bits you use, the fewer host addresses are available per subnet.

How this subnet mask calculator works

1) Parse the address and mask

The calculator validates the IPv4 format and converts both IP and mask into 32-bit numbers.

2) Find the network and broadcast

Network address is computed with a bitwise AND between IP and subnet mask. Broadcast address is found by setting all host bits to 1.

3) Derive host range and counts

From the network boundaries, the tool calculates total addresses and usable hosts. It also handles edge cases like /31 and /32 correctly.

Common CIDR values

CIDR Subnet Mask Total Addresses Usable Hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/27255.255.255.2243230
/30255.255.255.25242
/31255.255.255.25422 (point-to-point)
/32255.255.255.25511 (single host)

Why network engineers use subnet calculators

  • Plan VLANs and segmented networks accurately.
  • Avoid overlapping subnets in cloud and on-prem environments.
  • Speed up firewall, routing, and ACL configuration.
  • Reduce configuration errors during troubleshooting.

Quick example

If the IP is 192.168.1.130 with /24:

  • Subnet mask: 255.255.255.0
  • Network address: 192.168.1.0
  • Broadcast address: 192.168.1.255
  • Usable range: 192.168.1.1 - 192.168.1.254

Common mistakes to avoid

  • Using a non-contiguous subnet mask (invalid in standard IPv4 subnetting).
  • Forgetting that /31 and /32 behave differently than typical LAN subnets.
  • Confusing total addresses with usable host addresses.

Final thoughts

A reliable subnet mask calculator is one of the fastest ways to validate network design decisions. Whether you're studying CCNA topics, managing cloud VPCs, or maintaining enterprise LANs, having instant subnet details reduces mistakes and saves time.

🔗 Related Calculators

🔗 Related Calculators