Networking · 5 min read

CIDR & Subnets Explained

Understand CIDR notation, subnet masks, network and broadcast addresses, and how to calculate how many hosts a subnet holds.

By the ToolsHub team · Updated May 1, 2026

CIDR (Classless Inter-Domain Routing) notation describes a block of IP addresses as an address plus a prefix length, like 192.168.1.0/24. The number after the slash says how many leading bits are the network portion.

What the /prefix means

An IPv4 address has 32 bits. A /24 means the first 24 bits identify the network and the remaining 8 bits identify hosts — that's 2⁸ = 256 addresses. The subnet mask for /24 is 255.255.255.0.

Network, broadcast, and usable hosts

  • Network address — the first address in the block (all host bits 0).
  • Broadcast address — the last address (all host bits 1).
  • Usable hosts — everything in between. For /24, that's 256 − 2 = 254 usable addresses.

Smaller prefixes, bigger networks

A smaller prefix number means a bigger network: /16 holds 65,536 addresses, while /30 holds just 4 (2 usable) — handy for point-to-point links.

A quick CIDR reference

It helps to memorise a few common prefixes and the host counts they give (usable hosts are two fewer than the total, for the network and broadcast addresses):

  • /24 — 256 addresses, 254 usable (a typical small LAN).
  • /25 — 128 addresses, 126 usable.
  • /26 — 64 addresses, 62 usable.
  • /30 — 4 addresses, 2 usable (handy for point-to-point links).

Each step of one in the prefix halves the network size. To get the exact network address, broadcast address and host range for any block without doing the binary maths by hand, use our CIDR / Subnet Calculator.

Frequently asked questions

What does a CIDR like /24 mean?
The number after the slash is how many bits are fixed as the network portion. A /24 fixes 24 bits, leaving 8 for hosts — 256 addresses, of which 254 are usable.
How many hosts are in a /24 subnet?
A /24 has 256 total addresses but 254 usable, because the first (network) and last (broadcast) addresses are reserved. Our CIDR Calculator shows the exact range for any prefix.
What is a subnet mask?
A subnet mask like 255.255.255.0 marks which part of an IP is the network and which is the host. It's another way of writing the prefix — 255.255.255.0 equals /24.
Why do we use subnets?
Subnetting splits a large network into smaller ones to improve security, reduce congestion and organise devices logically. Each subnet has its own address range and can be managed separately.

Try the tool