How-To

How to Subnet a Network — Step by Step

A practical guide to subnetting: dividing a network into smaller subnets, calculating network addresses, and choosing the right prefix length.

The subnetting process

Subnetting divides a larger network into smaller segments. Each subnet borrows bits from the host portion, increasing the prefix length and creating more, smaller networks.

1
Determine how many subnets you need

If you need 4 subnets, you need at least 2 bits (2² = 4). For 6 subnets, you need 3 bits (2³ = 8, enough for 6).

2
Determine hosts per subnet needed

If a subnet needs 50 hosts, you need at least 6 host bits (2⁶ = 64, giving 62 usable). That means a /26.

3
Choose a prefix length

Your prefix must accommodate both requirements. Start with the parent block (e.g. /24) and extend it by the number of subnet bits.

4
Calculate subnet boundaries

The subnet size is 2^(32−prefix). For /26: 2^6 = 64. First subnet: .0, second: .64, third: .128, fourth: .192.

5
Verify you have room

Make sure the subnets fit within the parent block and that each has enough hosts for your needs.

Example: Split 192.168.1.0/24 into 4 subnets

We borrow 2 bits from the host portion of a /24 to create 4 equal /26 subnets:

Subnet CIDR Range Usable Hosts
1st 192.168.1.0/26 192.168.1.1 – 192.168.1.62 62
2nd 192.168.1.64/26 192.168.1.65 – 192.168.1.126 62
3rd 192.168.1.128/26 192.168.1.129 – 192.168.1.190 62
4th 192.168.1.192/26 192.168.1.193 – 192.168.1.254 62

Each /26 has 64 total IPs, 62 usable (first = network, last = broadcast).

Quick reference: bits borrowed → subnets

Bits Borrowed Subnets Created Starting from /24 Hosts per Subnet
1 2 /25 126
2 4 /26 62
3 8 /27 30
4 16 /28 14
5 32 /29 6
6 64 /30 2

Frequently Asked Questions

How do you calculate the number of subnets?

Use the formula 2n where n is the number of host bits borrowed. Borrowing 2 bits from a /24 gives 4 subnets (/26 each). Borrowing 3 bits gives 8 subnets (/27 each). Each borrowed bit doubles the number of subnets while halving the hosts per subnet.

How many usable hosts are in a subnet?

Usable hosts = 2h − 2, where h is the number of host bits remaining. Subtract 2 for the network address (first IP) and broadcast address (last IP). A /26 has 6 host bits: 2⁶ − 2 = 62 usable hosts. A /28 has 4 host bits: 2⁴ − 2 = 14 usable hosts.

What is a subnet boundary?

A subnet boundary is the starting address of each subnet, which must fall on a power-of-two multiple of the subnet block size. For a /26 (block size 64), the valid boundaries in a /24 are .0, .64, .128, and .192. Subnets that do not start on a valid boundary are invalid.

Use the calculator to verify your subnetting work: