Skip to content
ipaddress.si
IP addresses2 min read

CIDR and subnets, explained with examples

What /24 means, how to calculate network and broadcast addresses, and how to split a network into subnets — without memorising tables.

By ipaddress.si

CIDR notation looks cryptic — 10.20.0.0/14 — but it describes something simple: a block of consecutive addresses that share the same first bits.

The slash number

An IPv4 address has 32 bits. The number after the slash, the prefix length, says how many of those bits identify the network. The remaining bits identify hosts within it.

  • /24 → 24 network bits, 8 host bits → 2⁸ = 256 addresses
  • /26 → 26 network bits, 6 host bits → 2⁶ = 64 addresses
  • /30 → 2 host bits → 4 addresses

Every bit you add to the prefix halves the block; every bit you remove doubles it.

Subnet masks are the same thing

Older configuration uses a subnet mask: the prefix written as an address with all network bits set to 1. /24 is 255.255.255.0; /26 is 255.255.255.192. The wildcard mask used in some router ACLs is the inverse: 0.0.0.255 for a /24.

Network, broadcast and usable hosts

Take 192.168.10.77/26:

  1. The block size is 64, so blocks start at .0, .64, .128 and .192.
  2. .77 falls in the block starting at .64 → network address 192.168.10.64.
  3. The last address of the block is the broadcast address: 192.168.10.127.
  4. The usable hosts are everything in between: .65 – .126, which is 62 addresses.

Two special cases: a /31 has no broadcast — both addresses are usable on point-to-point links — and a /32 is a single host.

Splitting a network

To divide 10.0.0.0/22 (1,024 addresses) into four equal subnets, add two bits to the prefix (2² = 4): you get four /24s — 10.0.0.0/24, 10.0.1.0/24, 10.0.2.0/24 and 10.0.3.0/24. Subnets of different sizes are possible too (VLSM), as long as they don’t overlap.

IPv6 is the same, with bigger numbers

IPv6 uses identical notation. The difference is convention: a single LAN is a /64, and a site usually gets a /48 or /56. There is no broadcast address, so every address in a prefix can be used.

Let the calculator do it

The CIDR calculator shows the network, broadcast, masks, usable range and binary breakdown as you type, and the subnet calculator splits any IPv4 or IPv6 network into equal subnets. To turn an arbitrary range into CIDR blocks, use IP range to CIDR.

  • IP addresses2 min read

    Public vs private IP addresses

    Why your laptop's address starts with 192.168 while websites see something else — and what that means for connectivity and privacy.

  • IP addresses2 min read

    IPv4 vs IPv6: what actually changes

    Address size is the headline, but the real differences are in how networks are numbered, how devices configure themselves, and what happens to NAT.

  • IP addresses2 min read

    What is an IP address?

    The number that identifies your connection on the internet — what it is, who assigns it, and what it does and doesn't reveal about you.