Skip to tool
ecech.
🌐 Network & IP

Expand a CIDR Block Into Every Address, With the Reserved Ones Marked

A /24 is 256 addresses and 254 usable hosts. Get the explicit list, with the network and broadcast addresses labelled instead of quietly included.

Total addresses

Usable hosts

Network

Broadcast

Addresses



  
Advertisement

How the calculation works

192.168.1.0/28 — sixteen addresses, fourteen you can use .0 .1 through .14 .15 network 14 usable hosts broadcast A script that iterates all sixteen will try to reach two addresses no host answers on. Except in a /31 or /32, where the rule does not apply at all.

How to Use This Tool

Enter a block and get the addresses. The reserved ones are labelled rather than silently included, and you can choose to leave them out entirely.

Why a /24 gives 254 and not 256

Two addresses in every ordinary subnet are reserved:

  • The network address, all host bits zero, identifies the subnet itself. It appears in routing tables and is not assigned to a machine.
  • The broadcast address, all host bits one, reaches every host on the subnet at once. It is not a single machine either.

So usable hosts are total minus two. A /24 gives 254, a /28 gives 14, a /30 gives 2. Iterating the full range in a script means two addresses that nothing will ever answer on, which wastes scan time and looks like failed connections in logs.

The /31 and /32 exceptions

Applying minus-two to a /31 gives zero usable hosts, and to a /32 gives minus one. Both answers are wrong, and calculators that print them are applying a rule outside its range.

  • /32 is a single host — one address, usable. It is how you express one machine in a firewall rule or a route.
  • /31 is two addresses, and RFC 3021 allows both to be used, for point-to-point links between routers where there is nothing to broadcast to. It saves two addresses per link, which adds up across a large network.
Each step down doubles the block /30 4 addresses, 2 usable /28 16 addresses, 14 usable /24 256 addresses, 254 usable A /16 is 65,536 and a /8 is over sixteen million — far past the point of listing them.
Prefix length counts fixed bits, so a bigger number means a smaller block.

When not to expand a block

Anything larger than about a /16 produces a list nobody wants. Sixty-five thousand lines is already awkward; a /8 is over sixteen million and would freeze the tab before it finished. Output here is capped, and the count is still reported so you know what you asked for.

More to the point, most tools that take addresses also take CIDR notation, and giving them the block is better in every way: shorter, self-documenting, and it does not need regenerating when the subnet changes. Expand when the target genuinely cannot parse a prefix — some older appliances, some spreadsheet work, some ad-hoc scripts.

Private ranges worth recognising

  • 10.0.0.0/8 — 16.7 million addresses, the largest private block.
  • 172.16.0.0/12 — a million addresses; note it runs to 172.31, not 172.16 only.
  • 192.168.0.0/16 — 65,536 addresses, the home-router range.
  • 169.254.0.0/16 — link-local. An address here usually means DHCP failed.
  • 127.0.0.0/8 — loopback. The whole /8, not just 127.0.0.1.
Advertisement

Frequently Asked Questions

Why does a /24 have 254 usable hosts and not 256?
Because two addresses are reserved: the network address with all host bits zero, which identifies the subnet, and the broadcast address with all host bits one, which reaches every host at once. Neither is assignable to a machine, so usable hosts are always total minus two in an ordinary subnet.
How many usable hosts are in a /31?
Two. The minus-two rule does not apply, because RFC 3021 allows both addresses in a /31 to be used for point-to-point links between routers, where there is nothing to broadcast to. Calculators that report zero usable hosts for a /31 are applying a rule outside its range.
What about a /32?
One address, and it is usable. A /32 expresses a single host, which is how you write one machine in a firewall rule or a route. Applying minus-two here would give minus one, which is how you can tell a calculator is not handling the special cases.
Should I expand a CIDR block into a list?
Usually not. Most tools accept CIDR notation directly, and giving them the block is shorter, self-documenting and does not need regenerating when the subnet changes. Expand only when the target genuinely cannot parse a prefix — some older appliances, spreadsheet work, or ad-hoc scripts.
Why can't I expand a /8?
Because it is over sixteen million addresses, which would freeze the browser before the list finished rendering and would not be useful afterwards. The output here is capped and the true count is still reported, so you can see the size of what you asked for.
What does 169.254.x.x mean?
Link-local addressing, which a machine assigns itself when DHCP fails. Seeing one usually means the device could not reach a DHCP server rather than that anything is configured that way deliberately.

Related tools in Network & IP

Browse all Network & IP tools
The Mac mini the ecech. site is built on, beside a handwritten note reading ecech.com.

Made by one person

ecech. is not a content farm. Every tool here is written and checked by hand, one at a time, by someone who wanted the tool to exist and could not find a version that showed its working.

No accounts and no sign-in, and nothing you type reaches a server — every calculation on this page runs inside your browser. The ads are served by Google and do set their own cookies, which is set out in full on the privacy page. More about the site.