Subnet Calculator Guide: CIDR Notation & Subnetting Explained

Updated March 2026 · 8 min read

Subnetting is a core skill for network engineers, system administrators, and DevOps professionals. Whether you are segmenting a corporate network, configuring cloud VPCs, or setting up firewall rules, understanding how IP subnets work is essential. This guide covers CIDR notation, subnet masks, and practical subnetting with real-world examples.

What Is Subnetting?

Subnetting divides a large IP network into smaller, more manageable sub-networks (subnets). Each subnet has its own range of IP addresses and acts as a logical network segment. Benefits include:

CIDR Notation

CIDR (Classless Inter-Domain Routing) notation combines an IP address with a prefix length that indicates how many bits define the network portion. The format is IP/prefix:

192.168.1.0/24
|           |
|           +-- 24 bits for network, 8 bits for hosts
+-------------- Network base address

10.0.0.0/8    = 10.0.0.0 - 10.255.255.255 (16M addresses)
172.16.0.0/12 = 172.16.0.0 - 172.31.255.255 (1M addresses)
192.168.0.0/16 = 192.168.0.0 - 192.168.255.255 (65K addresses)

Subnet Mask Basics

A subnet mask is a 32-bit number that separates the network portion from the host portion of an IP address. The mask has consecutive 1-bits for the network part and 0-bits for the host part:

CIDR   Subnet Mask       Binary
/8     255.0.0.0         11111111.00000000.00000000.00000000
/16    255.255.0.0       11111111.11111111.00000000.00000000
/24    255.255.255.0     11111111.11111111.11111111.00000000
/25    255.255.255.128   11111111.11111111.11111111.10000000
/26    255.255.255.192   11111111.11111111.11111111.11000000
/27    255.255.255.224   11111111.11111111.11111111.11100000
/28    255.255.255.240   11111111.11111111.11111111.11110000
/30    255.255.255.252   11111111.11111111.11111111.11111100
/32    255.255.255.255   11111111.11111111.11111111.11111111

Key Addresses in a Subnet

AddressDescriptionExample (/24)
Network AddressFirst address, identifies the subnet192.168.1.0
First UsableFirst host address192.168.1.1
Last UsableLast host address192.168.1.254
Broadcast AddressLast address, broadcasts to all hosts192.168.1.255

Formula: Total addresses = 2^(32 - prefix). Usable hosts = total - 2 (network and broadcast addresses).

Common Subnet Sizes

CIDRMaskTotal IPsUsable HostsUse Case
/32255.255.255.25511Single host (loopback, ACL)
/30255.255.255.25242Point-to-point links
/28255.255.255.2401614Small office, DMZ
/24255.255.255.0256254Standard LAN segment
/20255.255.240.04,0964,094Medium VPC subnet
/16255.255.0.065,53665,534Large network / VPC

Subnetting Example: Splitting a /24 into Four /26 Subnets

Suppose you have 192.168.1.0/24 and need four equal subnets:

Original: 192.168.1.0/24 (256 IPs, 254 usable)
Split into /26 subnets (64 IPs each, 62 usable):

Subnet 1: 192.168.1.0/26
  Network:   192.168.1.0
  Range:     192.168.1.1 - 192.168.1.62
  Broadcast: 192.168.1.63

Subnet 2: 192.168.1.64/26
  Network:   192.168.1.64
  Range:     192.168.1.65 - 192.168.1.126
  Broadcast: 192.168.1.127

Subnet 3: 192.168.1.128/26
  Network:   192.168.1.128
  Range:     192.168.1.129 - 192.168.1.190
  Broadcast: 192.168.1.191

Subnet 4: 192.168.1.192/26
  Network:   192.168.1.192
  Range:     192.168.1.193 - 192.168.1.254
  Broadcast: 192.168.1.255

Cloud VPC Subnetting

When designing AWS, GCP, or Azure VPCs, plan your subnets carefully:

# Typical AWS VPC layout
VPC:            10.0.0.0/16     (65,534 IPs)

Public subnets:
  us-east-1a:   10.0.1.0/24    (254 IPs)
  us-east-1b:   10.0.2.0/24    (254 IPs)

Private subnets:
  us-east-1a:   10.0.10.0/24   (254 IPs)
  us-east-1b:   10.0.11.0/24   (254 IPs)

Database subnets:
  us-east-1a:   10.0.20.0/24   (254 IPs)
  us-east-1b:   10.0.21.0/24   (254 IPs)

Use the Subnet Calculator to quickly compute address ranges when planning VPC architectures. Verify your DNS records point to the correct subnets after deployment.

Private IP Address Ranges (RFC 1918)

RangeCIDRAddressesCommon Use
10.0.0.0 - 10.255.255.25510.0.0.0/816.7MCloud VPCs, large enterprises
172.16.0.0 - 172.31.255.255172.16.0.0/121MDocker default networks
192.168.0.0 - 192.168.255.255192.168.0.0/1665KHome/office LANs

FAQ

What is the difference between /24 and 255.255.255.0?

They mean the same thing. /24 is CIDR notation (24 network bits), while 255.255.255.0 is the dotted-decimal subnet mask. CIDR is more compact and is the modern standard.

Why can I not use the network and broadcast addresses for hosts?

The network address (all host bits = 0) identifies the subnet itself. The broadcast address (all host bits = 1) is used to send packets to all hosts on the subnet. Assigning either to a device would break routing.

How do I determine how many subnets I need?

Count the number of segments (departments, availability zones, environments) and add room for growth. A common practice is to allocate twice as many addresses as currently needed.

Try Subnet Calculator Now →

DevToolKit — 42+ Free Online Developer Tools