Skip to content

Guide · Networking basics

IP subnetting explained.

What subnetting is, why networks use it, and how to subnet an IPv4 address by hand — with worked examples, a subnetting table and the difference between subnetting and supernetting.

What is subnetting?

Subnetting is the practice of dividing a single IP network into several smaller networks called subnets. Each subnet has its own network address, broadcast address and range of host addresses. In subnetting in computer networks this is how a company turns one address block into separate networks for departments, floors, servers, guests and links between routers.

Subnetting definition: creating subnetworks by extending the network portion of an address into the host portion, so that a longer subnet mask (a larger CIDR prefix) identifies smaller networks.

Why do we subnet?

  • Less broadcast traffic. Broadcasts stay inside their own subnet, so a chatty segment does not slow the whole company.
  • Better security. Firewalls and ACLs can control traffic between subnets, isolating servers, guests or IoT devices.
  • Efficient addressing. Give each segment only the addresses it needs.
  • Simpler troubleshooting and routing. Failures and routes are easier to reason about when networks are small and well named.

Subnetting in 5 steps

  1. Know the starting network — for example 192.168.10.0/24.
  2. Decide how many subnets or hosts you need. Need 4 subnets? Borrow 2 bits (2² = 4).
  3. Write the new mask. /24 + 2 borrowed bits = /26 = 255.255.255.192.
  4. Find the block size. 256 − 192 = 64 addresses per subnet.
  5. List the subnets. Network addresses step by 64.

Worked example: splitting 192.168.10.0/24 into four subnets

SubnetNetworkUsable rangeBroadcast
1192.168.10.0/26.1 – .62192.168.10.63
2192.168.10.64/26.65 – .126192.168.10.127
3192.168.10.128/26.129 – .190192.168.10.191
4192.168.10.192/26.193 – .254192.168.10.255

Verify any row with the IP subnet calculator.

Subnetting table (IPv4)

This quick-reference IP subnetting table shows how many subnets you get when you borrow bits from a /24 network. The full table for every prefix is on the subnet mask cheat sheet.

Bits borrowedNew prefixSubnet maskSubnetsUsable hosts each
1/25255.255.255.1282126
2/26255.255.255.192462
3/27255.255.255.224830
4/28255.255.255.2401614
5/29255.255.255.248326
6/30255.255.255.252642

Subnetting vs supernetting

Subnetting takes one network and makes it smaller by lengthening the prefix: one /24 becomes two /25s. Supernetting (also called route aggregation or summarisation) takes several contiguous networks and makes them one larger network by shortening the prefix: 192.168.0.0/24 and 192.168.1.0/24 become 192.168.0.0/23. Supernetting only works when the networks are contiguous and the first network starts on a boundary that fits the new, larger block. CIDR made both techniques routine; the IP range calculator performs aggregation for you.

SubnettingSupernetting
DirectionSplits one networkMerges networks
PrefixGets longer (/24 → /26)Gets shorter (/24 → /23)
GoalSegmentation, efficiencySmaller routing tables
Used byLAN administratorsISPs, core routers

Subnetting and addressing: key terms

  • Network address – first address of the subnet; identifies the network.
  • Broadcast address – last address; reaches every host in the subnet.
  • Usable hosts – addresses between the two, assignable to devices.
  • Subnet mask / prefix – marks the network/host boundary. See the subnet mask calculator.
  • Default gateway – the router interface hosts use to leave their subnet.

Next steps

Test yourself with subnetting practice questions, plan uneven networks with VLSM, and read how VLSM, FLSM and CIDR differ. For the legacy ranges that older textbooks still use, see IP address classes.

Frequently asked questions

What is subnetting in computer networks?

Subnetting is dividing one IP network into smaller logical networks (subnets) by borrowing bits from the host portion of the address. It improves security, reduces broadcast traffic and makes address allocation more efficient.

What is the difference between subnetting and supernetting?

Subnetting splits a network into smaller ones by lengthening the prefix (e.g. /24 → two /25s). Supernetting, also called route aggregation or summarisation, combines several contiguous networks into one larger network by shortening the prefix (e.g. two /24s → one /23).

What is the definition of a subnet?

A subnet is a logically visible subdivision of an IP network, identified by a network address and a subnet mask or CIDR prefix.

How do I calculate the number of subnets?

If you borrow n bits, you create 2^n subnets. The number of hosts per subnet is 2^h − 2, where h is the remaining host bits.

Is subnetting still needed with IPv6?

Yes, but for organisation rather than conservation. IPv6 LANs use /64 subnets and sites typically receive a /48 or /56 to divide among VLANs.