Subnet Calculator Guide: How to Subnet an IP Network
Subnetting is a fundamental networking skill that allows you to divide a large IP network into smaller, more manageable subnetworks. Whether you are studying for a networking certification, planning a corporate network, or troubleshooting connectivity issues, understanding subnetting is essential. Our free subnet calculator makes it easy to compute subnet masks, network addresses, broadcast addresses, and host ranges.
What Is Subnetting?
Subnetting divides a single IP network into multiple smaller networks (subnets). This improves network performance by reducing broadcast traffic, enhances security by isolating network segments, and makes efficient use of IP address space. For example, a company with the network 192.168.1.0/24 can subnet it into four smaller networks, each supporting 62 hosts, instead of one network with 254 hosts.
Our subnet calculator takes an IP address and subnet mask (or CIDR prefix) and instantly shows you all the subnet details you need.
Understanding IP Addresses
An IPv4 address is a 32-bit number written as four octets (e.g., 192.168.1.100). Each octet ranges from 0 to 255 (8 bits). The address has two parts: the network portion (identifies the network) and the host portion (identifies a specific device on that network). The subnet mask determines where the network portion ends and the host portion begins.
For example, in 192.168.1.100 with a subnet mask of 255.255.255.0 (/24), the first three octets (192.168.1) identify the network, and the last octet (100) identifies the host. This network can support 254 hosts (2^8 - 2, excluding the network and broadcast addresses).
CIDR Notation Explained
CIDR (Classless Inter-Domain Routing) notation is a compact way to represent the subnet mask. It is written as an IP address followed by a slash and the number of bits in the network portion. For example:
- /24 = 255.255.255.0 — Supports 254 hosts (common for small office networks)
- /16 = 255.255.0.0 — Supports 65,534 hosts (used by large organizations)
- /25 = 255.255.255.128 — Supports 126 hosts (split a /24 into two subnets)
- /26 = 255.255.255.192 — Supports 62 hosts (four subnets from a /24)
- /30 = 255.255.255.252 — Supports 2 hosts (used for point-to-point links)
Our subnet calculator supports CIDR notation and converts between CIDR prefix length and dotted-decimal subnet mask automatically.
How to Subnet: Step by Step
- Determine requirements: How many subnets do you need? How many hosts per subnet?
- Calculate bits needed: For N subnets, you need at least log₂(N) bits borrowed from the host portion. For M hosts per subnet, you need at least log₂(M+2) host bits.
- Apply the new subnet mask: Add the borrowed bits to the original network prefix. If you borrow 2 bits from a /24 network, you get a /26 prefix.
- List subnets: Each subnet starts at an interval equal to 2^(host bits). For /26, the interval is 64 (2^6).
- Identify ranges: For each subnet, the first address is the network address, the last is the broadcast address, and usable hosts are everything in between.
Subnetting Example
You have the network 10.0.0.0/24 and need 4 subnets. You borrow 2 bits (2^2 = 4 subnets), giving you a /26 prefix (255.255.255.192). Each subnet has 64 addresses (2^6), with 62 usable hosts:
- Subnet 1: 10.0.0.0/26 — Hosts: 10.0.0.1 to 10.0.0.62 — Broadcast: 10.0.0.63
- Subnet 2: 10.0.0.64/26 — Hosts: 10.0.0.65 to 10.0.0.126 — Broadcast: 10.0.0.127
- Subnet 3: 10.0.0.128/26 — Hosts: 10.0.0.129 to 10.0.0.190 — Broadcast: 10.0.0.191
- Subnet 4: 10.0.0.192/26 — Hosts: 10.0.0.193 to 10.0.0.254 — Broadcast: 10.0.0.255
Our subnet calculator performs this calculation instantly for any network and any number of subnets.
Common Subnet Sizes
- /30 (4 addresses, 2 hosts): Point-to-point WAN links between routers
- /28 (16 addresses, 14 hosts): Small department or workgroup
- /24 (256 addresses, 254 hosts): Small office or home network
- /22 (1,024 addresses, 1,022 hosts): Medium business network
- /16 (65,536 addresses, 65,534 hosts): Large enterprise network
Private IP Address Ranges
RFC 1918 defines three private IP ranges for internal networks: 10.0.0.0/8 (10.x.x.x) for large networks, 172.16.0.0/12 (172.16-31.x.x) for medium networks, and 192.168.0.0/16 (192.168.x.x) for small networks. These addresses are not routable on the internet — NAT (Network Address Translation) is used to connect private networks to the internet.
Frequently Asked Questions
Why do we subtract 2 from host count? The first address in each subnet is the network address (all host bits 0) and the last is the broadcast address (all host bits 1). Neither can be assigned to a device.
What is VLSM? Variable Length Subnet Masking allows different subnets within the same network to have different sizes. This is more efficient than fixed-size subnets when host requirements vary.
How do I convert between binary and decimal for subnetting? Our base converter can convert between binary (base 2) and decimal (base 10), which is useful for understanding subnet masks at the bit level.
CalcSolver provides free online calculators for finance, health, math, and more. Visit CalcSolver for all 47+ tools — no signup required, 100% private.
Sponsored Content
The following content is provided by an ad partner and does not affect the calculator experience.