mask subnet calculator

IPv4 Mask & Subnet Calculator

Calculate network details from an IP address and either CIDR prefix or subnet mask.

If both CIDR and mask are entered, they must match.

What is a subnet mask?

A subnet mask divides an IPv4 address into two parts: the network portion and the host portion. It is essential for routing, IP planning, firewall design, VLAN segmentation, and preventing address conflicts.

For example, in 192.168.10.34/24, the first 24 bits describe the network and the remaining 8 bits describe hosts in that network. The subnet mask for /24 is 255.255.255.0.

How this mask subnet calculator helps

This tool instantly gives you key subnet information that network engineers and system administrators use every day:

  • Network address
  • Broadcast address
  • First and last usable host
  • Wildcard mask
  • Total and usable host count
  • Address class and scope type

How to use the calculator

Step 1: Enter an IP address

Input any valid IPv4 address such as 10.1.20.50 or 172.16.8.14.

Step 2: Enter CIDR or subnet mask

You can enter:

  • CIDR prefix like 24, 27, or 30
  • Subnet mask like 255.255.255.0

If both are entered, they must represent the same mask.

Step 3: Review network boundaries

Use the generated values for DHCP scopes, ACL rules, VPN routes, static route summarization, and documentation.

Quick practical examples

Example A: Typical home or office LAN

192.168.1.77/24 gives a network of 192.168.1.0 and a broadcast of 192.168.1.255. You get 254 usable host addresses.

Example B: Small segmented VLAN

10.10.5.130/26 creates a subnet range of 10.10.5.128 to 10.10.5.191 with 62 usable hosts. This is common for department-level VLANs.

Example C: Point-to-point link

172.20.3.8/31 is often used for router-to-router links. Under modern RFC behavior, both addresses in /31 can be usable.

Common subnetting mistakes to avoid

  • Using an invalid mask such as 255.0.255.0 (non-contiguous bits)
  • Forgetting that /32 is a single host route
  • Assuming /31 always has zero usable hosts in modern environments
  • Mixing private ranges with public routing without NAT planning
  • Overlapping subnets across VLANs or VPNs

Why subnetting still matters

Even with cloud networking, software-defined infrastructure, and automation, subnetting remains foundational. Correct mask planning improves security boundaries, simplifies route tables, reduces broadcast noise, and makes troubleshooting much faster.

Use this subnet mask calculator whenever you need a quick, reliable answer for IPv4 network design.

🔗 Related Calculators