← All Articles

What Is a Subnet Mask? Explained Simply

If you have ever configured a network device, you have probably seen a subnet mask like 255.255.255.0 and wondered what it means. Subnet masks are a fundamental part of how IP networking works, and understanding them is essential for anyone managing a network, setting up servers, or working in IT.

What Does a Subnet Mask Do?

A subnet mask determines which part of an IP address identifies the network and which part identifies the individual device (host) on that network. Think of it like a postal address: the city name identifies the general area (network), and the street address identifies the specific house (host).

When a device wants to communicate with another device, the subnet mask tells it whether the destination is on the same local network or if the traffic needs to be sent through a router (gateway) to reach a different network.

How Subnet Masks Work

An IPv4 address is 32 bits long, written as four octets (e.g., 192.168.1.100). The subnet mask is also 32 bits, and it divides the address into two parts:

  • Network portion — Identified by 1s in the binary subnet mask
  • Host portion — Identified by 0s in the binary subnet mask

Example

ComponentDecimalBinary
IP Address192.168.1.10011000000.10101000.00000001.01100100
Subnet Mask255.255.255.011111111.11111111.11111111.00000000
Network Address192.168.1.011000000.10101000.00000001.00000000
Host Part0.0.0.10000000000.00000000.00000000.01100100

The subnet mask 255.255.255.0 means the first 24 bits are the network portion and the last 8 bits identify individual devices. This allows up to 254 usable host addresses (256 minus the network address and broadcast address).

CIDR Notation

Instead of writing out the full subnet mask, network professionals use CIDR (Classless Inter-Domain Routing) notation. A slash followed by a number indicates how many bits are used for the network portion:

CIDRSubnet MaskUsable HostsCommon Use
/32255.255.255.2551Single host (used in whitelisting)
/24255.255.255.0254Small networks, home LANs
/16255.255.0.065,534Medium networks
/8255.0.0.016,777,214Large networks

For example, 192.168.1.0/24 represents all addresses from 192.168.1.0 to 192.168.1.255. This notation is used extensively in firewall rules, IP whitelisting, and cloud infrastructure configuration.

Common Subnet Masks

CIDRSubnet MaskTotal AddressesUsable Hosts
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/27255.255.255.2243230
/26255.255.255.1926462
/25255.255.255.128128126
/24255.255.255.0256254
/23255.255.254.0512510
/22255.255.252.01,0241,022
/21255.255.248.02,0482,046
/20255.255.240.04,0964,094
/16255.255.0.065,53665,534

Why Subnetting Matters

Subnetting serves several critical purposes:

  • Network segmentation — Divide a large network into smaller, manageable segments. This improves performance and security
  • Efficient IP usage — Assign only as many addresses as needed instead of wasting large blocks
  • Broadcast control — Smaller subnets mean smaller broadcast domains, reducing unnecessary network traffic
  • Security isolation — Separate sensitive systems (databases, admin panels) onto their own subnets
  • Routing efficiency — Routers can summarize routes, reducing the size of routing tables

Private IP Address Ranges

Certain IP ranges are reserved for private networks (not routable on the public internet). These are defined in RFC 1918:

RangeCIDRSubnet MaskCommon Use
10.0.0.0 - 10.255.255.25510.0.0.0/8255.0.0.0Large enterprises, cloud VPCs
172.16.0.0 - 172.31.255.255172.16.0.0/12255.240.0.0Medium-sized organizations
192.168.0.0 - 192.168.255.255192.168.0.0/16255.255.0.0Home and small office networks

Your router uses NAT (Network Address Translation) to allow devices with private IPs to communicate on the public internet through a single public IP address. You can check your public IP at WheresThatIP.com.

Subnetting Example: Dividing a /24 Network

Suppose you have the network 192.168.1.0/24 (254 usable hosts) and you want to divide it into 4 equal subnets:

  1. A /24 has 8 host bits. To create 4 subnets, you need 2 more network bits (2^2 = 4), making each subnet a /26
  2. Each /26 subnet has 62 usable hosts
SubnetNetwork AddressUsable RangeBroadcast
1192.168.1.0/26192.168.1.1 - 192.168.1.62192.168.1.63
2192.168.1.64/26192.168.1.65 - 192.168.1.126192.168.1.127
3192.168.1.128/26192.168.1.129 - 192.168.1.190192.168.1.191
4192.168.1.192/26192.168.1.193 - 192.168.1.254192.168.1.255

How to Find Your Subnet Mask

Windows

ipconfig

Look for "Subnet Mask" under your active network adapter.

Mac

ifconfig | grep netmask

Linux

ip addr show

The CIDR notation appears after the IP address (e.g., 192.168.1.100/24).

Subnet Masks and IP Lookup

When you look up a public IP address using our IP Lookup tool, the results often include the network range and CIDR notation. This tells you the size of the network block assigned to that organization. Our WHOIS tool provides even more detail about network allocations.

Frequently Asked Questions

What is the default subnet mask?

The most common default subnet mask is 255.255.255.0 (/24), which is used by most home routers. This allows up to 254 devices on the local network.

Does the subnet mask affect internet speed?

No. The subnet mask defines network boundaries, not bandwidth. However, a very large subnet can increase broadcast traffic, which could slow down the local network.

What is the difference between a subnet mask and a gateway?

The subnet mask defines which addresses are on your local network. The gateway (default gateway) is the IP address of the router that forwards traffic to other networks, including the internet.