Subnet Calculator

Calculate the number of addresses and usable hosts in an IPv4 subnet from the CIDR prefix.

256

Total addresses

Total addresses256
Usable hosts254
Subnet mask (bits)24 bits
ℹ️ Addresses = 2^(32 − prefix). Usable hosts are 2 fewer (network and broadcast addresses).
Share:

The subnet calculator works out the number of addresses and usable hosts in an IPv4 subnet from its CIDR prefix. It is a handy aid for planning networks and sizing address space.

How the calculator works and what it’s for

How the subnet size is calculated

The total number of addresses follows addresses = 2^(32 − prefix). The smaller the prefix number, the larger the network and the more addresses it holds.

Usable hosts are typically two fewer, because the network address and the broadcast address are reserved separately.

What you enter and what you get

Enter the CIDR prefix, for example /24. You get the total number of addresses, the count of usable hosts and the subnet mask in bits.

A /24, for instance, gives 256 addresses, of which 254 are usable for hosts.

Who it is for and when

It suits network administrators, students and home-network builders planning how to divide an address space.

It helps you make sure a subnet has room for enough devices without wasting addresses unnecessarily.

Tips for interpreting it

A smaller prefix number grows the network, while a larger number splits the address space into smaller blocks. Choose the prefix to match the number of devices.

Remember to leave room for growth: if more devices are added, a prefix that is too tight will have to be redesigned.

🔄 Reviewed June 2026

Frequently asked questions

Related calculators