Skip to content
Local Only Dev Tools
5 min read

CIDR vs Subnet Mask: Practical Examples

Translate between prefix length and dotted mask, and calculate usable hosts accurately.

Quick answer

A /24 prefix and 255.255.255.0 describe the same network boundary; the prefix counts network bits.

Two ways to say the same thing

A prefix such as /24 and a dotted mask such as 255.255.255.0 describe the same boundary between network and host bits. The prefix counts the network bits.

Calculate the usable range

The first address is the network address and the last is broadcast. In a /24 that leaves 254 usable hosts, from .1 through .254.

  • •/24 → mask 255.255.255.0 → 254 hosts
  • •/26 → mask 255.255.255.192 → 62 hosts
  • •/30 → 2 usable point-to-point addresses

Avoid off-by-one errors

Enter the host address itself, not a guess at the network address — the calculator normalizes it to the correct block.

Common mistakes

  • •Counting reserved addresses as hosts
  • •Off-by-one host ranges
  • •Using the wrong mask for a prefix

When to use this

  • •Subnet planning
  • •Firewall rules
  • •Cloud networking

Try it yourself

Compute network address, broadcast address, usable host range and host count for a CIDR block. Runs locally in your browser.

Open CIDR Calculator