What is subnet mask

Last updated: April 1, 2026

Quick Answer: A subnet mask is a network address that divides an IP address into network and host portions, determining which devices can communicate directly on the same network. It's essential for routing data in TCP/IP networks.

Key Facts

Overview

A subnet mask is a crucial component of Internet Protocol (IP) networking that works alongside IP addresses to determine network boundaries and routing paths. When an IP address is transmitted across a network, the subnet mask tells devices which portion of the IP address refers to the network itself and which portion identifies individual hosts on that network. This division is fundamental to how modern networks function and how data gets routed from source to destination.

How Subnet Masks Work

Every device on a network has an IP address and a subnet mask. When a device needs to send data, it uses the subnet mask to determine whether the destination device is on the same local network or requires routing through intermediate networks. The subnet mask consists of a series of 1s followed by 0s in binary format. The 1s represent the network portion of an IP address, while the 0s represent the host portion. For example, the subnet mask 255.255.255.0 means the first three octets (24 bits) identify the network, and the last octet (8 bits) identifies individual hosts.

Notation and Formats

Subnet masks are commonly expressed in two formats. Dotted decimal notation looks like 255.255.255.0, where each number represents 8 bits. CIDR notation (Classless Inter-Domain Routing) is more concise, using a slash followed by the number of network bits, such as /24 or /16. Both formats convey the same information; a /24 network mask and 255.255.255.0 are equivalent. CIDR notation has become more popular in modern networking and documentation.

Common Subnet Masks

Certain subnet masks are widely used as standards. A /24 mask (255.255.255.0) allows 254 usable host addresses on a network and is typical for small office networks. A /16 mask (255.255.0.0) supports 65,534 hosts and suits larger enterprises. A /8 mask (255.0.0.0) is used for massive networks with millions of devices. The choice of subnet mask depends on how many devices a network needs to support and how many separate networks an organization requires.

Subnetting and Network Design

Subnet masks enable subnetting, the practice of dividing a large network into smaller subnetworks. This improves efficiency, security, and management. For example, a company might use a /16 network and divide it into multiple /24 subnets for different departments. Subnetting reduces broadcast traffic, improves performance, and makes security controls more granular. Network administrators use subnet calculators to plan optimal subnet divisions based on organizational needs.

Related Questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) notation expresses subnet masks concisely using a slash and number, like 192.168.1.0/24. It replaced older classful networking and allows more flexible IP address allocation and routing.

What is the difference between network and broadcast addresses?

The network address is the lowest address in a subnet, used to identify the network itself. The broadcast address is the highest address, used to send data to all devices on that subnet. Neither can be assigned to individual devices.

How do you calculate subnets?

Subnet calculation involves determining how many bits to borrow from the host portion to create subnets. You use formulas like 2^n (where n is borrowed bits) to find usable addresses, though subnet calculators simplify this process considerably.

Sources

  1. Wikipedia - Subnetwork CC-BY-SA-4.0
  2. Cisco - Subnet Masks proprietary