Skip to Calculator
/24
Subnet Calculator
Engineering Authority & RFC Standards

The Complete Subnetting Guide: Formulas, Examples & Edge Cases

Master IPv4 and IPv6 subnetting with worked real-world examples, mathematical derivation of binary formulas, Variable Length Subnet Masking (VLSM), and deep dives into edge cases like RFC 3021 /31 router links and /32 host routes.

Instant Subnet Practice & Solution Verifier

Verify your manual calculations
Network Address:172.16.50.64
Broadcast Address:172.16.50.95
Usable Host Range:172.16.50.65 - .94
Usable Hosts:30

1. The Fundamental Subnetting Formulas

Every IPv4 subnet calculation is governed by three mathematical identities derived from the 32-bit register architecture:

#1

Number of Usable Hosts

H = 2^(32 - P) - 2

H = 2^(32 - P) - 2. Where P is the prefix length and 32 - P is the number of host bits. Two addresses are reserved (Network and Directed Broadcast).

#2

Subnets Created (Bits Borrowed)

S = 2^(borrowed bits)

S = 2^(borrowed bits). When borrowing N bits from the host portion of an existing prefix (e.g. from /24 to /26, borrowing 2 bits), you create 2^2 = 4 new subnets.

#3

Block Size (Increment)

Increment = 256 - Octet Mask

Increment = 256 - Octet Mask. For a subnet mask of 255.255.255.224, the interesting octet is 224. The block size is 256 - 224 = 32. Networks increment by 32.

2. Step-by-Step Worked Example: Dividing a /24 into Four /26 Subnets

Suppose an organization owns the Class C private network 192.168.1.0/24 and needs to segment it into four equal departments (Engineering, Marketing, Sales, Operations).

Step 1: Calculate Borrowed Bits

To create 4 subnets, we need 2^N ≥ 4 → N = 2 bits. New prefix: 24 + 2 = /26.

Step 2: Calculate New Subnet Mask & Block Size

Fourth octet has two 1s: 11000000 = 192 → Mask: 255.255.255.192. Block size: 256 - 192 = 64 addresses per subnet.

Step 3: Calculate Subnet Boundaries
#Subnet CIDRUsable Host RangeBroadcast AddressUsable Hosts
#1192.168.1.0/26192.168.1.1 - 192.168.1.62192.168.1.6362
#2192.168.1.64/26192.168.1.65 - 192.168.1.126192.168.1.12762
#3192.168.1.128/26192.168.1.129 - 192.168.1.190192.168.1.19162
#4192.168.1.192/26192.168.1.193 - 192.168.1.254192.168.1.25562

3. Variable Length Subnet Masking (VLSM) Strategy

VLSM enables engineers to allocate different subnet masks to different subnets within the same routing domain, preventing address exhaustion.

4. Subnetting Edge Cases: RFC 3021 /31 & /32 Host Routes

Point-to-point router links use /31 (RFC 3021) without broadcast addresses, while single host routes use /32 for loopback interfaces.

Related Networking Calculators & Engineering Tools