Networking2026-04-048 min read

What is a subnet mask?

Learn what a subnet mask does, how it defines network boundaries, and how it relates to CIDR notation and usable host ranges.

What a subnet mask is

A subnet mask is used to define which part of an IPv4 address represents the network and which part represents individual hosts.

It is typically written in dotted-decimal format, such as 255.255.255.0.

How a subnet mask works

A subnet mask works by using binary values to separate network and host portions of an IP address.

Bits set to 1 represent the network portion, while bits set to 0 represent the host portion.

IP Address:   192.168.1.10
Subnet Mask:  255.255.255.0

Binary:
11111111.11111111.11111111.00000000

Network: 192.168.1.0
Host:    .10

Subnet mask and CIDR notation

Subnet masks are closely related to CIDR notation. CIDR uses a slash format to represent the same boundary.

  • 255.255.255.0 → /24
  • 255.255.255.128 → /25
  • 255.255.255.224 → /27
  • 255.255.255.252 → /30

Learn more here: /articles/what-is-cidr-notation

Network, broadcast, and usable range

The subnet mask determines three key values in a network:

  • Network address → the first address in the range
  • Broadcast address → the last address in the range
  • Usable host range → all addresses between those two
Network:   192.168.1.0
Broadcast: 192.168.1.255
Usable:    192.168.1.1 - 192.168.1.254

Why subnet masks matter

Subnet masks are essential for routing, network segmentation, and device communication.

If a subnet mask is incorrect, devices may misinterpret whether an address is local or remote, leading to connectivity issues.

Where you will see subnet masks

  • IP configuration on devices
  • Cloud networking (Azure, AWS, etc.)
  • Firewall and routing rules
  • VPN configurations
  • Subnet planning and documentation

How to calculate subnet ranges

You can calculate subnet ranges and convert between subnet masks and CIDR using DNS Pro: https://app.dnspro.co.uk

# Example using ipcalc
ipcalc 192.168.1.0 255.255.255.0