Home
My IP
GPS
Find Me
Your Location
4️⃣IPv4:
📍...
6️⃣IPv6:
🌍...
🏢...
📌...
How-To Guides15 min read

Subnet Calculator Guide: Understanding CIDR Notation and Subnetting

Master IP subnetting and CIDR notation with practical examples, subnet tables, and step-by-step calculations for network planning and troubleshooting.

By WhatIsMyLocation Team·Updated January 30, 2026
Subnet Calculator Guide: Understanding CIDR Notation and Subnetting

Subnet Calculator Guide: Understanding CIDR Notation and Subnetting

Subnetting is one of the most important skills in networking, yet it is also one of the most intimidating for newcomers. Whether you are studying for a networking certification, planning a corporate network, or simply trying to understand why your home devices are on a "192.168.1.x" network, this guide will teach you subnetting from first principles.

We will start with the basics of binary addressing, build up to CIDR notation, walk through manual subnet calculations step by step, and provide reference tables that make real-world subnetting fast. You can also use our Subnet Calculator tool to perform these calculations instantly.

Why Subnetting Exists

In the early internet, IP addresses were allocated using a classful system:

ClassRangeDefault MaskNetworksHosts per Network
A1.0.0.0 - 126.255.255.255/8 (255.0.0.0)12616,777,214
B128.0.0.0 - 191.255.255.255/16 (255.255.0.0)16,38465,534
C192.0.0.0 - 223.255.255.255/24 (255.255.255.0)2,097,152254

This system was enormously wasteful. An organization that needed 300 IP addresses would receive a Class B allocation (65,534 addresses), wasting over 65,000 addresses. Subnetting solves this by allowing network administrators to divide IP address blocks into smaller, right-sized segments.

Understanding Binary and IP Addresses

To truly understand subnetting, you need to be comfortable with binary representation. An IPv4 address is a 32-bit number, typically written as four decimal octets:

192.168.1.100 in decimal
11000000.10101000.00000001.01100100 in binary

Each octet is 8 bits, so the range for each octet is 0 (00000000) to 255 (11111111). Here is a quick binary-to-decimal reference for powers of 2:

Bit Position76543210
Value1286432168421

To convert binary to decimal, add the values of all positions that have a 1. For example:

10101000 = 128 + 0 + 32 + 0 + 8 + 0 + 0 + 0 = 168

Subnet Masks Explained

A subnet mask is a 32-bit number that divides an IP address into two parts: the network portion and the host portion. The mask consists of a contiguous block of 1s (network bits) followed by a contiguous block of 0s (host bits).

Example

IP Address:    192.168.1.100    = 11000000.10101000.00000001.01100100
Subnet Mask:   255.255.255.0    = 11111111.11111111.11111111.00000000
                                   |----- network -----|-host-|

When you perform a bitwise AND between the IP address and the subnet mask, you get the network address:

11000000.10101000.00000001.01100100  (IP: 192.168.1.100)
AND
11111111.11111111.11111111.00000000  (Mask: 255.255.255.0)
=
11000000.10101000.00000001.00000000  (Network: 192.168.1.0)

All devices with IP addresses in the range 192.168.1.1 through 192.168.1.254 are on the same network (192.168.1.0/24). Address 192.168.1.0 is the network address (used to identify the subnet) and 192.168.1.255 is the broadcast address (used to send messages to all devices on the subnet).

CIDR Notation

CIDR (Classless Inter-Domain Routing) notation provides a compact way to express an IP address and its subnet mask. Instead of writing the full subnet mask, you append a slash followed by the number of network bits:

192.168.1.0/24    means    192.168.1.0 with mask 255.255.255.0
10.0.0.0/8        means    10.0.0.0 with mask 255.0.0.0
172.16.0.0/12     means    172.16.0.0 with mask 255.240.0.0

The number after the slash is called the prefix length and indicates how many bits of the address are used for the network portion. Our Subnet Calculator accepts both CIDR notation and traditional subnet masks.

Complete CIDR Reference Table

Here is the complete reference table for all common prefix lengths:

CIDRSubnet MaskAddressesUsable HostsTypical Use
/32255.255.255.25511Single host route
/31255.255.255.25422Point-to-point links (RFC 3021)
/30255.255.255.25242Point-to-point links (traditional)
/29255.255.255.24886Small office
/28255.255.255.2401614Small department
/27255.255.255.2243230Medium department
/26255.255.255.1926462Large department
/25255.255.255.128128126Half a Class C
/24255.255.255.0256254Standard network
/23255.255.254.0512510Two Class C networks
/22255.255.252.01,0241,022Four Class C networks
/21255.255.248.02,0482,046Small campus
/20255.255.240.04,0964,094Medium campus
/16255.255.0.065,53665,534Large organization
/8255.0.0.016,777,21616,777,214Massive network

Note: "Usable Hosts" is total addresses minus 2 (the network address and broadcast address), except for /31 which is a special case used for point-to-point links.

Step-by-Step Subnetting Examples

Example 1: Basic Subnet Calculation

Given: 192.168.10.0/26

Step 1: Determine the subnet mask.

/26 means 26 network bits and 6 host bits.

Mask: 11111111.11111111.11111111.11000000 = 255.255.255.192

Step 2: Calculate the number of addresses.

Host bits = 32 - 26 = 6

Total addresses = 2^6 = 64

Usable hosts = 64 - 2 = 62

Step 3: Identify the network range.

Network address: 192.168.10.0

First usable: 192.168.10.1

Last usable: 192.168.10.62

Broadcast: 192.168.10.63

Step 4: Identify the next subnet.

The next subnet starts at 192.168.10.64/26 (the address after the broadcast address of the first subnet).

Example 2: Finding Which Subnet a Host Belongs To

Given: Host IP 10.45.67.200 with mask /20

Step 1: Convert to binary and apply the mask.

10.45.67.200  = 00001010.00101101.01000011.11001000
/20 mask      = 11111111.11111111.11110000.00000000
AND result    = 00001010.00101101.01000000.00000000
              = 10.45.64.0

Step 2: The network address is 10.45.64.0/20.

Step 3: Calculate the range.

Host bits = 12, Total addresses = 4,096

Network: 10.45.64.0

Broadcast: 10.45.79.255

Usable range: 10.45.64.1 - 10.45.79.254

So host 10.45.67.200 is within the 10.45.64.0/20 subnet.

Example 3: Dividing a Network Into Equal Subnets

Task: Divide 172.16.0.0/16 into 8 equal subnets.

Step 1: Calculate additional bits needed.

8 subnets requires 3 additional bits (2^3 = 8).

New prefix: /16 + 3 = /19

Step 2: List the subnets.

SubnetNetwork AddressUsable RangeBroadcast
1172.16.0.0/19172.16.0.1 - 172.16.31.254172.16.31.255
2172.16.32.0/19172.16.32.1 - 172.16.63.254172.16.63.255
3172.16.64.0/19172.16.64.1 - 172.16.95.254172.16.95.255
4172.16.96.0/19172.16.96.1 - 172.16.127.254172.16.127.255
5172.16.128.0/19172.16.128.1 - 172.16.159.254172.16.159.255
6172.16.160.0/19172.16.160.1 - 172.16.191.254172.16.191.255
7172.16.192.0/19172.16.192.1 - 172.16.223.254172.16.223.255
8172.16.224.0/19172.16.224.1 - 172.16.255.254172.16.255.255

Each subnet has 8,190 usable host addresses (2^13 - 2).

You can verify all of these calculations using our Subnet Calculator, which shows the network address, broadcast address, usable range, and total hosts for any CIDR block.

Variable-Length Subnet Masking (VLSM)

VLSM allows you to use different subnet sizes within the same network, allocating addresses more efficiently. Instead of creating eight equal /19 subnets, you can create subnets of different sizes based on actual need.

Example scenario: You have 10.0.0.0/24 and need to create subnets for:

  • Department A: 100 hosts
  • Department B: 50 hosts
  • Department C: 25 hosts
  • Server room: 10 hosts
  • Two point-to-point links: 2 hosts each

Solution (allocate largest first):

DepartmentRequiredSubnetUsableNetwork
Dept A100/25 (128 addresses)12610.0.0.0/25
Dept B50/26 (64 addresses)6210.0.0.128/26
Dept C25/27 (32 addresses)3010.0.0.192/27
Servers10/28 (16 addresses)1410.0.0.224/28
Link 12/30 (4 addresses)210.0.0.240/30
Link 22/30 (4 addresses)210.0.0.244/30

This allocates addresses efficiently with minimal waste. Without VLSM, you would need separate /24 networks for each department.

Private Address Ranges

Three IPv4 address ranges are reserved for private networks (RFC 1918). These addresses are not routable on the public internet and can be freely used within any organization:

RangeCIDRAddressesTypical Use
10.0.0.0 - 10.255.255.25510.0.0.0/816,777,216Large enterprises
172.16.0.0 - 172.31.255.255172.16.0.0/121,048,576Medium organizations
192.168.0.0 - 192.168.255.255192.168.0.0/1665,536Home and small office

Your home network almost certainly uses 192.168.0.0/24 or 192.168.1.0/24. You can verify by comparing your device's local IP with the public IP shown on our My IP page. If they differ, you are behind NAT on a private subnet.

IPv6 Subnetting

IPv6 subnetting follows the same principles but with much larger numbers. The standard practice is:

  • ISPs assign a /48 to each customer (or /56 for residential)
  • Each /48 contains 65,536 /64 subnets
  • Each /64 subnet supports 2^64 (18.4 quintillion) host addresses

IPv6 subnetting is generally simpler because address space is abundant, eliminating the need for careful conservation through VLSM. Explore IPv6 addressing with our IPv6 Tools.

Key Takeaways

  • Subnetting divides a network into smaller segments by extending the network portion of the IP address
  • CIDR notation (e.g., /24) indicates the number of network bits in the subnet mask
  • The number of usable hosts is 2^(32 - prefix length) - 2
  • VLSM allows mixing subnet sizes for efficient address allocation
  • Always allocate the largest subnets first when using VLSM
  • Private address ranges (10.x, 172.16-31.x, 192.168.x) are for internal use only
  • Use our Subnet Calculator for instant calculations on any CIDR block

Related Articles:

W

WhatIsMyLocation Team

Our team of network engineers and web developers builds and maintains 25+ free networking and location tools used by thousands of users every month. Every article is reviewed for technical accuracy using real-world testing with our own tools.

Related Articles

Try Our Location Tools

Find your IP address, GPS coordinates, and more with our free tools.