Subnet Calculator
Calculate the number of addresses and usable hosts in an IPv4 subnet from the CIDR prefix.
256
Total addresses
| Total addresses | 256 |
| Usable hosts | 254 |
| Subnet mask (bits) | 24 bits |
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
Character Counter
Count the characters in your text and see how much fits social media limits
Printing Cost Calculator
Calculate the total cost of printing from page count, paper and ink prices
Cloud Storage Calculator
Calculate how many photos, songs or videos fit in your storage based on file size
Battery Life Calculator
Estimate your device battery life from its capacity and power consumption
Solar Panel Calculator
Estimate the yearly electricity output and money saved by your solar panel system
Volume Calculator
Calculate the volume of a box or cylinder in cubic metres and litres.