IP Subnet Calculator

Find the network, broadcast, host range and mask for a subnet.

Result

Network address
192.168.1.0
Broadcast address
192.168.1.255
Usable host range
192.168.1.1 – 192.168.1.254
Subnet mask
255.255.255.0 (/24)
Total hosts
256
Usable hosts
254
Export:

How subnetting works

An IPv4 address is 32 bits long. A CIDR prefix such as /24 marks how many of those leading bits identify the network, leaving the rest to number individual hosts within it. The calculator splits the address along that boundary.

From the prefix it derives the subnet mask, then masks the address down to its network number, sets the trailing host bits to find the broadcast address, and lists the usable host range in between.

Reading the result

The output describes the whole block your address belongs to, not just the single address you entered.

  • Network address: the first address, used to name the subnet itself.
  • Broadcast address: the last address, used to reach every host at once.
  • Usable host range: the addresses you can actually assign to devices.
  • Total hosts is 2^(32 − prefix); usable hosts is that count minus two.

Choosing a prefix

A smaller prefix number means a larger network with more hosts; a larger prefix carves out smaller subnets. Pick a size that fits the number of devices plus a little room to grow.

  • /24 gives 254 usable hosts, a common size for a small office LAN.
  • /30 gives 2 usable hosts, handy for point-to-point links.

Caveats and common mistakes

Enter a valid dotted-quad address with each octet between 0 and 255, and a prefix between 0 and 32. A /31 or /32 leaves no room for separate network and broadcast addresses, so the usable count is shown as zero.

Remember that the network and broadcast addresses are reserved and should not be assigned to a device.

Formula

hosts = 2^(32 − prefix); usable = hosts − 2

Frequently asked questions

Why are there fewer usable hosts than total hosts?
Each subnet reserves its first address for the network identifier and its last for the broadcast address, so usable hosts equals total minus two (for /31 and /32 the usable count is shown as zero).