network subnet mask calculator

Enter a value from 0 to 32 (for example, 24 means /24).

What this network subnet mask calculator does

This calculator helps you quickly break down an IPv4 subnet using two inputs: an IP address and a CIDR prefix (such as /24 or /27). Instead of calculating bit boundaries manually, you instantly get the subnet mask, network address, broadcast address, host range, wildcard mask, and address counts.

It is useful for system administrators, network engineers, students preparing for networking certifications, and anyone who works with routers, firewalls, or cloud VPC settings.

How subnet masks and CIDR work

A subnet mask tells devices which part of an IP address is the network portion and which part is the host portion. CIDR notation is a shorter way to represent that mask: /24 means 24 bits are fixed for the network, leaving 8 bits for hosts.

  • /8 = 255.0.0.0
  • /16 = 255.255.0.0
  • /24 = 255.255.255.0
  • /30 = 255.255.255.252

In practical networking, this directly affects how many subnets you can create and how many addresses each subnet can contain.

Quick reference table for common CIDR values

CIDR Subnet Mask Total Addresses Usable Hosts (Typical)
/24 255.255.255.0 256 254
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/29 255.255.255.248 8 6
/30 255.255.255.252 4 2

Practical example

Input

IP address: 192.168.1.130
Prefix: /24

Result highlights

  • Network address: 192.168.1.0
  • Broadcast address: 192.168.1.255
  • Usable host range: 192.168.1.1 through 192.168.1.254
  • Total addresses: 256

This means all devices from 192.168.1.1 to 192.168.1.254 can be assigned to hosts in that subnet, while .0 is the network ID and .255 is the broadcast address.

Common subnetting mistakes to avoid

  • Using an invalid IP format (for example, octets above 255).
  • Confusing CIDR /24 with a host count of 24 (it is actually 254 usable hosts in most cases).
  • Forgetting that /31 and /32 have special use cases.
  • Overlapping subnets in VLAN, VPN, or cloud environments.

Why this matters for real networks

Good subnet planning improves network performance, security segmentation, and troubleshooting speed. Whether you are splitting office LANs into VLANs, allocating address blocks in AWS/Azure/GCP, or designing home lab environments, subnet math is foundational.

Use this calculator for quick design checks, exam prep, and day-to-day operations when you need accurate subnet details without manual binary conversion every time.

🔗 Related Calculators