Handeware
Computers

Usable hosts

254
Total addresses
256

Subnet Calculator

An IPv4 network is written with a slash and a prefix length, such as 192.168.1.0/24. The prefix sets how many addresses the network holds. This shows that count.

How it works

An IPv4 address has 32 bits, and the prefix says how many of them are fixed for the network. The rest give two to the power of the leftover bits in total addresses.

Usable hosts are the total minus two, because the first address names the network and the last is the broadcast address.

Worked example

A network with a prefix of /24 holds 256 addresses, and 254 of them are usable for devices.

Questions

What does the number after the slash mean?

It is how many leading bits identify the network. A bigger number means a smaller network.

Why subtract two?

The first address names the network and the last one is the broadcast address, so neither goes to a device.

What about /31 and /32?

These are special cases. A /31 link between two routers uses both addresses, and a /32 names a single address. This shows the simple count.

More like this

All Computers calculators