What Is a Subnet Mask? Subnetting Explained Simply
If you've ever configured a router or studied for a networking cert, you've run into subnet masks. They look intimidating (255.255.255.0), but the concept behind them is straightforward once you see the analogy. This guide explains subnetting in plain English, from the basics to practical application.
Try the Subnet Calculator
Enter any IP and CIDR prefix to see the full breakdown: network address, host range, broadcast, and more.
Subnet CalculatorThe Street Address Analogy
Think of it like a street address. The street name is the network. The house number is the host. The subnet mask tells the network where the street name ends and the house number begins. It's where the street name ends and the house number begins. In a /24 network like 192.168.1.0/24, the "street" is 192.168.1, and the "house numbers" go from 1 to 254. Every device on this network shares the first three numbers and differs only in the last one.
What the Numbers Mean
An IPv4 address is 32 bits written as four numbers separated by dots (192.168.1.100). Each ranges from 0-255. The subnet mask is also 32 bits, where the "1" bits represent the network portion and the "0" bits represent the host portion. The mask 255.255.255.0 in binary is 11111111.11111111.11111111.00000000, meaning 24 "network" bits and 8 "host" bits. This is written as /24 in CIDR notation.
CIDR Notation: The Shorthand
Nobody writes out full subnet masks anymore. CIDR notation is cleaner: the number after the slash tells you how many bits are network vs host. The bits used for the network portion. A /24 means 24 network bits (subnet mask 255.255.255.0). A /16 means 16 network bits (subnet mask 255.255.0.0). A /28 means 28 network bits (subnet mask 255.255.255.240), leaving only 4 host bits for 14 usable addresses. The smaller the CIDR number, the larger the network.
How Many Hosts Per Subnet?
Quick math: 2^(32 - prefix) - 2 = usable hosts. You lose 2 addresses every time -- first is the network ID, last is the broadcast address is the broadcast address (sends data to all hosts on the subnet). A /24 gives you 2^8 - 2 = 254 usable hosts. A /27 gives 2^5 - 2 = 30 usable hosts. A /30 gives just 2 usable hosts, which is perfect for point-to-point links between two routers.
Why Subnet at All?
Why subnet? Three reasons. Security: devices on different subnets can't talk without going through a router, so you can wall off servers, IoT junk, guest WiFi) from each other. Performance: Network broadcasts (like ARP requests) only reach devices on the same subnet, reducing unnecessary traffic. A single flat /16 network with 65,000 devices would drown in broadcast traffic. Organization: Subnets make IP address management cleaner. You can assign 10.0.1.0/24 to the engineering team, 10.0.2.0/24 to marketing, and 10.0.3.0/24 to guest access, making it obvious which network a device belongs to.
Private IP Address Ranges
Three IP ranges are set aside for private networks. You'll never see these on the public internet: 10.0.0.0/8 (10.0.0.0 to 10.255.255.255) has over 16 million addresses and is used by large organizations. 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) provides about 1 million addresses. 192.168.0.0/16 (192.168.0.0 to 192.168.255.255) is the default for most home routers. When you see 192.168.1.x on your home network, your devices share a single public IP address through NAT (Network Address Translation) on your router.
Practical Examples
Home network: Your router probably uses 192.168.1.0/24, giving you 254 usable addresses (192.168.1.1 through 192.168.1.254). That's more than enough for typical household devices. Small office: A /24 per department works well. 192.168.10.0/24 for the office network, 192.168.20.0/24 for VoIP phones, 192.168.30.0/24 for guest WiFi. Cloud VPC: AWS and Azure typically start with a /16 VPC (65,534 addresses) subdivided into /24 subnets for public-facing and private tiers. The Subnet Calculator lets you enter any IP/CIDR combination to see the complete breakdown.
For related tools, the Binary Converter helps visualize IP addresses in binary, and the Password Generator creates secure credentials for your network devices.