You're setting up a router and it asks for the subnet mask. Or you're reading a server config and see "192.168.1.0/24." What does the slash-number mean? CIDR notation is the modern way to describe IP ranges, and learning it is one of those "click" moments in networking.

The basic idea

An IPv4 address is 32 bits, written as 4 numbers (each 0–255) separated by dots. Each number is a byte (8 bits). 192.168.1.10 in binary is:

11000000 . 10101000 . 00000001 . 00001010

The CIDR suffix /N says "the first N bits identify the network; the remaining 32-N bits identify the host within the network."

So 192.168.1.0/24 means:

  • First 24 bits (3 bytes) = network: 192.168.1
  • Last 8 bits (1 byte) = hosts: .0 to .255
  • Total addresses: 256 (2⁸)
  • Usable hosts: 254 (the .0 and .255 are reserved)

Common CIDR sizes

CIDRMaskHostsCommon use
/8255.0.0.016,777,214Old "Class A" range
/16255.255.0.065,534Old "Class B" range; large enterprise networks
/24255.255.255.0254Standard small/home network
/27255.255.255.22430Small office segment
/30255.255.255.2522Point-to-point links
/32255.255.255.2551Single host

The smaller the CIDR number, the larger the network (more host bits).

The math: why /24 has 254 usable hosts

2⁸ = 256 total addresses in a /24. Two are reserved:

  • The first address (192.168.1.0): the network address. Identifies the subnet itself.
  • The last address (192.168.1.255): the broadcast address. Sends to all hosts on the subnet.

So usable host addresses: 256 − 2 = 254. Same logic for any subnet: 2^(host bits) − 2.

What's reserved at /31 and /32?

Modern networking allows /31 (point-to-point links) where both addresses ARE usable — there's no broadcast on a 2-host link. /32 is a single specific host (used in routing tables).

For typical subnets larger than /30, expect to lose 2 addresses to network and broadcast.

Subnet masks (the old format)

Before CIDR, subnets were described with a "subnet mask" — a separate IP address showing which bits are network. The mask for /24 is 255.255.255.0:

  • 255 = 8 binary 1s = "this byte is all network bits"
  • 0 = 8 binary 0s = "this byte is all host bits"

CIDR /24 = mask 255.255.255.0. Same thing, more compact notation.

Subnetting in practice: dividing a network

You have 10.0.0.0/16 (65,534 hosts). You want to break it into 4 smaller subnets:

  • Each new subnet needs about 16,000 host addresses.
  • 16,000 = roughly 2¹⁴ = 16,384.
  • So each subnet uses 14 host bits, meaning 32 - 14 = 18 network bits = /18.
  • 4 /18 subnets fit inside one /16.

The 4 subnets:

  • 10.0.0.0/18 (hosts .0.1 to .63.254)
  • 10.0.64.0/18 (hosts .64.1 to .127.254)
  • 10.0.128.0/18 (hosts .128.1 to .191.254)
  • 10.0.192.0/18 (hosts .192.1 to .255.254)

Common patterns

Home network: typically 192.168.0.0/24 or 192.168.1.0/24. 256 addresses, 254 usable. Plenty for most homes.

Small business: 192.168.0.0/16 (65,536 addresses) or break into VLANs at /24 each.

Cloud (AWS/GCP): 10.0.0.0/16 is the typical VPC default. Subnets are usually /24 inside.

Point-to-point links between routers: /30 or /31 (4 or 2 addresses, 2 usable).

Reserved IP ranges

Three private (internal-only) ranges:

  • 10.0.0.0/8: 10.x.x.x. Largest private range; corporate networks.
  • 172.16.0.0/12: 172.16.x.x to 172.31.x.x. Mid-sized.
  • 192.168.0.0/16: 192.168.x.x. Home and small business.

Plus loopback (127.0.0.0/8) and link-local (169.254.0.0/16). The other ~3.7 billion addresses are public.

IPv6 changes everything

IPv6 addresses are 128 bits, far more than IPv4's 32 bits. CIDR notation extends to /1 through /128. Common IPv6 subnet sizes:

  • /64: standard subnet (18 quintillion addresses each — silly large)
  • /56: typical home or small business allocation (256 /64 subnets)
  • /48: typical larger enterprise allocation (65,536 /64 subnets)

You'll never run out of IPv6 addresses in any reasonable scenario. Most subnetting concerns evaporate.

Calculate your subnet

Our IP subnet calculator takes any CIDR block and returns the network address, broadcast address, host range, netmask, and number of usable hosts. Useful for validating router configs, planning subnets, or just checking "wait, how many hosts does /22 have again?"