nicetool.dev logo
#networking#devops#ip

Subnetting and CIDR Explained: Reading /24, /26 and /30 Without a Calculator

What the number after the slash in 192.168.1.0/24 really means, how to find the network, broadcast and usable host range in your head, the /31 and /30 special cases, and the private ranges to know.

5 min read

Sooner or later every backend or DevOps engineer meets a CIDR block: a VPC is 10.0.0.0/16, a security group allows 203.0.113.0/24, a Kubernetes pod range is /14. The notation looks cryptic, but the idea behind it is simple, and once it clicks you can read most blocks without any tool. This guide builds that intuition, then shows the handful of special cases worth memorizing.

An IP address is just 32 bits

An IPv4 address like 192.168.1.10 is four numbers, each 0-255, so each fits in 8 bits. Together they are one 32-bit number. Writing it in binary is the key to understanding subnets:

192      . 168      . 1        . 10
11000000 . 10101000 . 00000001 . 00001010

A subnet splits those 32 bits into two parts: a network part (the left bits, shared by every address in the subnet) and a host part (the right bits, which identify a specific machine). CIDR notation tells you where the split is.

The number after the slash

In 192.168.1.0/24, the /24 is the prefix length: the first 24 bits are the network, and the remaining 32 - 24 = 8 bits are for hosts. The mask is those 24 one-bits followed by eight zeros:

/24 mask = 11111111.11111111.11111111.00000000 = 255.255.255.0

So a larger prefix means a smaller network. A /24 has 8 host bits; a /26 has 6; a /30 has only 2. Each extra bit in the prefix halves the number of addresses.

Prefix Mask Host bits Total addresses
/24 255.255.255.0 8 256
/25 255.255.255.128 7 128
/26 255.255.255.192 6 64
/27 255.255.255.224 5 32
/28 255.255.255.240 4 16
/29 255.255.255.248 3 8
/30 255.255.255.252 2 4

The pattern for the last mask octet is worth memorizing: 128, 192, 224, 240, 248, 252, 254. Each is the previous plus the next power of two.

Network, broadcast and usable hosts

Within any subnet, two addresses are reserved:

  • The network address is the first one, with all host bits set to 0. It names the subnet itself.
  • The broadcast address is the last one, with all host bits set to 1. A packet sent here reaches every host in the subnet.

Everything in between is usable for actual machines. So the usable count is total − 2.

Take 192.168.1.0/26 (64 addresses):

  • Network: 192.168.1.0
  • Broadcast: 192.168.1.63
  • Usable range: 192.168.1.1 to 192.168.1.62 (62 hosts)

The next /26 subnet starts right after, at 192.168.1.64, then 192.168.1.128, then 192.168.1.192. That jump of 64 is the block size: 256 − 192 = 64, where 192 is the mask's last octet. The block size is the fastest way to find subnet boundaries by hand: for a /27, the mask octet is 224, so the block size is 32, and subnets start at .0, .32, .64, .96 and so on.

The /31 and /30 special cases

Point-to-point links (a router connected directly to another router) need only two usable addresses. A /30 gives exactly that: 4 total, minus network and broadcast, leaves 2 usable. It is the classic choice for such links.

A /31 is stranger. By the total − 2 rule it would have zero usable hosts, which is useless. RFC 3021 fixes this: on a /31, both addresses are usable, specifically for point-to-point links, because a two-host link does not need a broadcast address. So a /31 gives 2 usable hosts from 2 total. A /32 is a single host, used for a loopback, a host route, or allow-listing one exact IP in a firewall rule.

Our Subnet Calculator follows RFC 3021, so a /31 and /32 correctly report every address as usable, which trips up calculators that blindly subtract 2.

Wildcard masks

Some tools, notably Cisco access lists and some firewall rules, use a wildcard mask instead of a subnet mask. It is the bit-for-bit inverse: where the subnet mask has a 1, the wildcard has a 0. For /24:

subnet mask   = 255.255.255.0
wildcard mask = 0.0.0.255

A 0 in the wildcard means "this bit must match", a 1 means "any value". So 0.0.0.255 means "match the first three octets, ignore the last", which is the same set of addresses as /24.

Private ranges and other reserved blocks

Not every address is routable on the public internet. These private ranges (RFC 1918) are reserved for internal networks and appear in almost every cloud VPC:

Range CIDR Addresses
10.0.0.0 - 10.255.255.255 10.0.0.0/8 ~16.7 million
172.16.0.0 - 172.31.255.255 172.16.0.0/12 ~1 million
192.168.0.0 - 192.168.255.255 192.168.0.0/16 65,536

A few more worth recognizing:

  • 127.0.0.0/8 loopback (127.0.0.1 is localhost).
  • 169.254.0.0/16 link-local (an auto-assigned address when DHCP fails; also the cloud metadata endpoint 169.254.169.254).
  • 100.64.0.0/10 carrier-grade NAT, and increasingly used by VPN tools like Tailscale.

Splitting a block into subnets

A common task is carving a larger block into smaller ones, for example splitting 10.0.0.0/24 into four /26 subnets for separate tiers:

Subnet Range Usable
10.0.0.0/26 .0 - .63 .1 - .62
10.0.0.64/26 .64 - .127 .65 - .126
10.0.0.128/26 .128 - .191 .129 - .190
10.0.0.192/26 .192 - .255 .193 - .254

Going from /24 to /26 adds 2 bits to the prefix, which creates 2^2 = 4 subnets. In general, moving from /n to /m makes 2^(m−n) subnets. The subnet calculator can split a block and list every resulting subnet, which is handy when planning address space for a VPC.

A word on IPv6

IPv6 uses the same CIDR idea, but addresses are 128 bits instead of 32, written in hex. A typical allocation to a site is a /48, and a single subnet is almost always a /64 (leaving 64 bits for hosts, which is an enormous number). Because the host part is so large, you rarely do host-count math in IPv6; you count subnets instead. There is also no broadcast address and no total − 2 rule. The subnet calculator handles IPv6 input too.

Quick reference

  • Prefix = network bits; 32 − prefix = host bits (IPv4).
  • Total addresses = 2^(host bits); usable = total − 2 (except /31 and /32).
  • Block size = 256 − (last mask octet); subnets start at multiples of it.
  • Memorize the mask octets: 128, 192, 224, 240, 248, 252, 254.
  • 10/8, 172.16/12, 192.168/16 are private.

Once these click, most CIDR blocks are readable at a glance. For the awkward ones, or to split a block or check IPv6, paste it into the Subnet Calculator: it shows the network, broadcast, mask, wildcard, host range, usable count, class and scope, in both decimal and binary, entirely in your browser.

Written by

Nguyễn Thành Nam

Full-Stack Engineer · Backend & Platform

Full-stack engineer with 9+ years of experience building high-traffic APIs and platforms with Go, NestJS, PHP (Laravel, Phalcon) and Node.js. Specializes in GraphQL API design, real-time systems and performance optimization, and builds NICETOOL.dev for the developer community.

Try it yourself

Related articles