Skip to content
IT

Subnet Calculator Guide: How to Subnet an IP Network

IT Guide

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:

Our subnet calculator supports CIDR notation and converts between CIDR prefix length and dotted-decimal subnet mask automatically.

How to Subnet: Step by Step

  1. Determine requirements: How many subnets do you need? How many hosts per subnet?
  2. 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.
  3. 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.
  4. List subnets: Each subnet starts at an interval equal to 2^(host bits). For /26, the interval is 64 (2^6).
  5. 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:

Our subnet calculator performs this calculation instantly for any network and any number of subnets.

Common Subnet Sizes

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.

← Back to all articles

CalcSolver provides free online calculators for finance, health, math, and more. Visit CalcSolver for all 47+ tools — no signup required, 100% private.

Sponsored

Sponsored Content

The following content is provided by an ad partner and does not affect the calculator experience.