Home
Choose where the table starts.
Choose where the table ends.
Common slices:

📘 VLSM Worked Example — 192.168.5.0/24

VLSM (Variable Length Subnet Mask) lets you split one address block into subnets of different sizes. The rule is always: largest subnet first, working down to the smallest.

Requirements: 100 hosts, 50 hosts, 25 hosts, 10 hosts, 5 hosts, 2 hosts. The base network is 192.168.5.0/24 (256 addresses).

Step 1 — Sort descending: 100, 50, 25, 10, 5, 2.
Step 2 — Pick the smallest mask that fits each requirement:
  • 100 hosts → /25 (126 usable)
  • 50 hosts → /26 (62 usable)
  • 25 hosts → /27 (30 usable)
  • 10 hosts → /28 (14 usable)
  • 5 hosts → /29 (6 usable)
  • 2 hosts → /30 (2 usable)
Step 3 — Allocate from the start of the block:
Subnet Prefix Mask Network Broadcast Usable Range Hosts
1/25255.255.255.128192.168.5.0192.168.5.127.1 – .126126
2/26255.255.255.192192.168.5.128192.168.5.191.129 – .19062
3/27255.255.255.224192.168.5.192192.168.5.223.193 – .22230
4/28255.255.255.240192.168.5.224192.168.5.239.225 – .23814
5/29255.255.255.248192.168.5.240192.168.5.247.241 – .2466
6/30255.255.255.252192.168.5.248192.168.5.251.249 – .2502

The remaining addresses (192.168.5.252 – 192.168.5.255) are left unused — that is the price of variable-length allocation, and it is far cheaper than giving every subnet a full /24.

Subnetting Quick-Reference Rules

Six rules that let you subnet in your head without a calculator. Every one of them is derived from the /0–/32 table above.

Rule Formula / Shortcut Example
Block size 256 − last non-255 octet of the mask /26 → 256 − 192 = 64
Subnets from a /24 2(prefix − 24) /26 → 2² = 4 subnets
Usable hosts 2(32 − prefix) − 2 /26 → 2⁶ − 2 = 62
Subnet address Largest multiple of block size ≤ IP octet .130 in a /26 → 128
Broadcast address Next subnet − 1 (last octet = 255 if possible) /26 at .128 → broadcast .191
Point-to-point /30 = 2 hosts · /31 = 2 hosts (RFC 3021) · /32 = 1 host /30 → .1 and .2 usable

Powers of Two You Should Memorise

2¹ = 2 2² = 4 2³ = 8 2⁴ = 16 2⁵ = 32
2⁶ = 64 2⁷ = 128 2⁸ = 256 2⁹ = 512 2¹⁰ = 1,024
2¹¹ = 2,048 2¹² = 4,096 2¹³ = 8,192 2¹⁴ = 16,384 2¹⁵ = 32,768
2¹⁶ = 65,536

Binary Octet Values (128 · 64 · 32 · 16 · 8 · 4 · 2 · 1)

An octet is eight bits with place values 128, 64, 32, 16, 8, 4, 2, 1. The subnet mask 255.255.255.192 is 11111111.11111111.11111111.11000000 — the last octet uses 128 + 64 = 192, leaving 6 host bits (2⁶ − 2 = 62 hosts).

What Is Subnetting?

Subnetting is the practice of dividing a single IPv4 address block into smaller, logically separated networks. Each resulting subnet has its own network address, broadcast address and usable host range. Routers move traffic between subnets; switches keep it inside them.

The dividing line between the network portion and the host portion of an address is set by the subnet mask, written either in dotted-decimal (255.255.255.192) or CIDR notation (/26). CIDR counts the number of leading 1-bits, so /26 means 26 network bits and 6 host bits.

IPv4 address: 192.168.1.130 = 11000000.10101000.00000001.10000010
Subnet mask: 255.255.255.192 = 11111111.11111111.11111111.11000000
Network: 192.168.1.128 = 11000000.10101000.00000001.10000000

Why the First and Last Addresses Are Unusable

In every subnet two addresses are reserved:

  • Network address — all host bits set to 0. It identifies the subnet itself and cannot be assigned to a host.
  • Broadcast address — all host bits set to 1. It reaches every host in the subnet, so it cannot be assigned to a single device.

That is why a /24 has 256 total addresses but only 254 usable hosts. The only exception is /31, defined by RFC 3021 for point-to-point links, which uses both addresses as host addresses and has no broadcast.

Subnet Mask vs. Wildcard Mask

The wildcard mask is the bitwise inverse of the subnet mask. It is used in Cisco ACLs and OSPF statements to indicate which bits must match and which are "don't care":

Subnet mask /26: 255.255.255.192 (11111111.11111111.11111111.11000000)
Wildcard mask /26: 0.0.0.63 (00000000.00000000.00000000.00111111)

A wildcard of 0.0.0.0 means "match exactly"; a wildcard of 0.0.0.255 means "ignore the last octet". The full wildcard-mask column is included in the CIDR reference table above.

VLSM in One Paragraph

Variable Length Subnet Masking allows subnets of different sizes inside the same address block. The algorithm is always the same: sort the requirements from largest to smallest, choose the smallest mask that fits each requirement, and allocate the subnets sequentially from the start of the block. A /25 followed by a /26, a /27 and a /30 is perfectly valid VLSM — and far more efficient than slicing everything into equal /26s.

Golden rule: never allocate a larger subnet after a smaller one. If you do, the address space becomes fragmented and the larger subnet may no longer fit.

Why Use This Subnetting Cheat Sheet?

  • Full /0–/32 table: subnet mask, wildcard mask, block size, total addresses and usable hosts in one scrollable view.
  • Interactive calculator: paste any IP/CIDR and get network, broadcast, first/last host and binary breakdown.
  • VLSM planner: enter a base network and a comma-separated host list to see the allocation built for you.
  • Practice quiz: randomised CCNA-style questions with instant explanations.
  • Memory rules: the six shortcuts that let you subnet without a calculator.
  • Free & private: runs entirely in your browser — no IP address is sent to a server.

❓ Subnetting Cheat Sheet FAQ

What is the fastest way to subnet in my head?

Memorise the block sizes for /25–/30: 128, 64, 32, 16, 8, 4. The block size is 256 − last non-255 octet of the mask. Subnet boundaries are multiples of the block size, and the broadcast is the next boundary minus one.

How many usable hosts does a /26 have?

A /26 leaves 6 host bits, so 2⁶ = 64 total addresses. Subtract the network and broadcast addresses: 62 usable hosts. The mask is 255.255.255.192 and the wildcard is 0.0.0.63.

What is the difference between a /30 and a /31?

A /30 has 4 addresses, of which 2 are usable hosts (the other two are network and broadcast). A /31, defined by RFC 3021, uses both addresses as host addresses and has no broadcast — it is designed for point-to-point links. A /32 is a single host route.

Why is my subnet mask 255.255.255.192 equal to /26?

Count the 1-bits: 255 = 8 ones, so three 255 octets contribute 24 bits. The last octet 192 = 11000000 in binary, which adds 2 more ones. 24 + 2 = 26, so the prefix is /26.

What is a wildcard mask used for?

Wildcard masks are the inverse of subnet masks and are used in Cisco ACLs, OSPF network statements and route-maps. A 0 bit means "must match", a 1 bit means "don't care". For /24 the wildcard is 0.0.0.255; for /26 it is 0.0.0.63.

Can I use VLSM with private addresses?

Yes — VLSM is independent of whether the address space is public or private. RFC 1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are the most common base networks for VLSM because they offer plenty of room to split.

Does this tool support IPv6 subnetting?

This page focuses on IPv4 (32-bit) subnetting. IPv6 uses 128-bit addresses and a prefix length from /0 to /128, but the bit-level logic is the same. The CIDR table here covers the full IPv4 /0–/32 range.

Is this cheat sheet free and private?

Yes. It is completely free, requires no registration, and every calculation — including the quiz and VLSM planner — runs locally in your browser. No IP address is ever transmitted to a server.