Skip to main content

2026-02-22

8 min

By Formatho Editorial

IPv4 Subnetting Made Simple

NetworkingIPv4DevOps
Digital security lock representing password protection

The one idea behind subnetting

An IPv4 address is 32 bits. A subnet mask says which leading bits are the network and which trailing bits are hosts. CIDR notation /26 means the first 26 bits are network; the remaining 6 bits identify hosts — so the network contains 26 = 64 addresses, of which 62 are usable (network and broadcast addresses are reserved).

The math you'll actually use

usable hosts = 2^(32 - prefix) - 2
block size   = 256 - mask-octet

For a /26: mask is 255.255.255.192, block size is 256−192 = 64, so subnets start at .0, .64, .128, .192 within the fourth octet. The network address is the first, broadcast the last, gateway conventionally the first usable.

Common CIDR table

CIDRMaskUsable hosts
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/30255.255.255.2522 (point-to-point)

A worked example

Split 10.0.4.0/24 into four equal subnets. Four subnets need 2 bits → borrow 2 host bits → /26 each:

  • 10.0.4.0/26 — hosts .1–.62, broadcast .63
  • 10.0.4.64/26 — hosts .65–.126, broadcast .127
  • 10.0.4.128/26 — hosts .129–.190, broadcast .191
  • 10.0.4.192/26 — hosts .193–.254, broadcast .255

Pitfalls

  • "Which subnet does 10.0.4.100/26 belong to?" — the answer is 10.0.4.64/26, found by masking (100 AND 192 = 64). Address ≠ network address; always derive the network.
  • Size for growth: a /27 (30 hosts) is full at 25 devices once you reserve gateway and a couple of infrastructure addresses.
  • Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — cloud VPCs default inside these; overlapping ranges break VPN routing later.

Run these calculations instantly — mask, wildcard, ranges, host counts, split planning — in the IPv4 Subnet Calculator.

Formatho Editorial — written and maintained by the team behind formatho.com, a library of free, privacy-first developer tools that run entirely in your browser. Every guide is tested against the tools it describes. Corrections and suggestions: github.com/formatho.