Subnet Calculator
Hosts, mask and ranges for a CIDR block.
Enter your values
Enter the cidr prefix you are working with.
Enter the hosts needed you are working with.
Results update instantly as you type — no submit needed. Your values are remembered on this device, and the shareable link reopens the calculator with exactly these numbers.
- 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.
Usable hosts = 2^(32 − prefix) − 2
At a glance
| What it does | Hosts, mask and ranges for a CIDR block. |
|---|---|
| Category | Technology |
| Inputs needed | CIDR prefix, Hosts needed |
| Main output | Usable hosts |
| Formula | Usable hosts = 2^(32 − prefix) − 2 |
| Cost | Free — no sign-up, no download |
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.
Inputs explained
- CIDR prefix
- Enter the cidr prefix you are working with.
- Hosts needed
- Enter the hosts needed you are working with.
Worked example
Using the values the calculator loads with:
Inputs
- CIDR prefix24
- Hosts needed200
Results
- Usable hosts254
- Subnet mask255.255.255.0
- Total addresses256
- Prefix for hosts needed/24
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.
What do I need to enter into the Subnet Calculator?
Just 2 values: cidr prefix, hosts needed. Every field starts with a realistic example, so you can change one number at a time and watch the result update instantly.
How does the Subnet Calculator work out the answer?
A CIDR prefix defines how many bits are network bits, which sets the host count. It applies the formula Usable hosts = 2^(32 − prefix) − 2 and shows the working so you can check each step by hand.
Is the Subnet Calculator free, and do I need an account?
It is completely free with no sign-up, no download and no usage limit. Everything is calculated in your browser, so the numbers you type never leave your device.
Results are estimates for general information. For medical, legal, structural or financial decisions, confirm with a qualified professional.