Subnet Calculator (IPv4)
Calculate network, broadcast, host range and host count from CIDR.
About the Subnet Calculator (IPv4)
Calculates the key properties of an IPv4 subnet from an address and CIDR prefix: subnet mask, network address, broadcast address, usable host range and number of hosts.
How to use
Enter an IP address and CIDR prefix (e.g. 192.168.1.10/24), then click Calculate.
Worked example
192.168.1.10/24 → network 192.168.1.0, broadcast 192.168.1.255, 254 usable hosts.
How to use this calculator
- Enter an IPv4 network in CIDR form, such as 192.168.1.0/24.
- Read the calculated network address, broadcast address, host range, and usable host count.
- Use the host count to check whether the subnet is large enough for your devices.
- Compare nearby CIDR sizes if you need a smaller or larger subnet.
The formula explained
$$ \text{host count} = 2^{32 - \text{prefix}} - 2 $$
- \(\text{prefix}\) = the CIDR prefix length, such as 24 in 192.168.1.0/24
- \(\text{host count}\) = the number of usable host addresses in the subnet
- \(\text{network address}\) = the first address in the subnet block
- \(\text{broadcast address}\) = the last address in the subnet block
- \(\text{host range}\) = the usable addresses between the network and broadcast addresses
Step by step method
- Start with the IP address and CIDR prefix.
- Determine how many bits are left for hosts by subtracting the prefix from 32.
- Use those host bits to find the size of the block and the usable address count.
- Identify the network address as the first address and the broadcast address as the last address.
- List the usable host range between those two endpoints.
Worked example
Here is a practical example using a small office subnet, 192.168.1.0/24.
- A /24 leaves 8 host bits, so the subnet contains \(2^8 = 256\) total addresses.
- Subtract the network and broadcast addresses, leaving \(256 - 2 = 254\) usable host addresses.
- For 192.168.1.0/24, the network address is 192.168.1.0 and the broadcast address is 192.168.1.255.
- The usable host range runs from 192.168.1.1 to 192.168.1.254.
Answer. 192.168.1.0/24 has 254 usable hosts, with host range 192.168.1.1 to 192.168.1.254.
Tips and common mistakes
- Remember that the network and broadcast addresses are not usable by devices.
- A smaller CIDR number means a larger subnet, while a larger CIDR number means a smaller subnet.
- Check the prefix carefully, since one digit difference can change the host count a lot.
- If you only need the usable hosts, use the host count rather than the total address count.
Frequently asked questions
What is CIDR?+
Classless Inter-Domain Routing notation: the /24 is the number of network bits.
Why 254 hosts in a /24?+
256 addresses minus the network and broadcast addresses.
More Tech Tools Tools
Explore related calculators in this category
AI API Cost Calculator
Estimate LLM API cost from input/output tokens and per-token prices.
Accessible Color Pair Finder
Check if a text/background pair meets WCAG and suggest a fix. Free tool with instant calculations, the underlying formula, and an easy-to-follow example.
Barcode Generator
Generate Code 128 / EAN barcodes from your data.
Browser Info Detector
Show details about your browser, OS and screen.
You Might Also Like
Popular tools from other categories
.htaccess Generator
Generate common .htaccess rules, force HTTPS, www redirect, and caching, with checkboxes.
1031 Exchange Calculator - Free Online
Free Calculate tax deferral in a 1031 exchange. Step-by-step solutions and formulas included. Fast, accurate, and free, with formula and example.
4% Rule Calculator
Find the retirement nest egg you need using the 4% safe-withdrawal rule.
70% Rule Calculator
Calculate max offer using the 70% rule for flips.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.