Subnet Calculator
Hosts, mask and ranges for a CIDR block.
Reviewed by James Whitfield · How we check our maths
Your values
ⓘ Live results
Results
- Usable hosts
- 254
- Subnet mask
- 255.255.255.0
- Total addresses
- 256
- Prefix for hosts needed
- /24
Quick answer
A CIDR prefix defines how many bits are network bits, which sets the host count.
The formula
Usable hosts = 2^(32 − prefix) − 2
Worked example
Worked example
Using the values the calculator loads with.
Inputs
- CIDR prefix24
- Hosts needed200
Result
- Usable hosts254
- Subnet mask255.255.255.0
- Total addresses256
- Prefix for hosts needed/24
How to use the Subnet Calculator
- 1Enter the CIDR prefix length.
- 2Enter how many hosts you need.
- 3Use the suggested prefix if the current one is too small.
Frequently asked questions
Why subtract two hosts?
The network and broadcast addresses are not assignable.
What is a /24?
256 addresses, 254 usable — the classic small office subnet.
About this calculator
- Built and reviewed by James Whitfield · How we build and test calculators
- Report an error