CIDR Host Count Calculator
Enter a CIDR prefix length to count usable hosts.
Result
How it is calculated
Only the prefix length is needed. Total addresses: 2^(32 - prefix). Usable hosts: 2^(32 - prefix) - 2, because the first address (network) and the last (broadcast) cannot be given to a device. The subnet mask is the prefix written as 32 bits, with prefix ones followed by zeros, then split into four decimal octets.
Two special cases are built in. A /31 reports 2 usable hosts, following the point-to-point rule where no network or broadcast address is reserved. A /32 reports 1, a single host. Everything from /0 to /30 follows the general formula. Enter a whole number from 0 to 32, without the slash: a decimal, a value above 32, or text such as "/24" returns no result. The tool counts addresses in a block; it does not know which of them your network already uses.
Worked example
You want to know what a /27 gives you. There are 32 - 27 = 5 host bits, so the block holds 2^5 = 32 addresses in total. Subtract the network and broadcast addresses: 32 - 2 = 30 hosts are usable. The mask has 27 one-bits: the first three octets are 255 each, and the last octet has three one-bits (128 + 64 + 32 = 224), so the tool shows 255.255.255.224. A /27 therefore suits a network of up to 30 devices.
Common mistakes
- Typing /27 with the slash. The field takes the plain number 27 and returns nothing for "/27".
- Reporting 32 addresses as 32 hosts. For prefixes up to /30, two addresses are reserved, so the usable count is always total minus two.
- Choosing a subnet that exactly fits today's device count. A network of 30 devices on a /27 has no room to grow, and gateways and other infrastructure also use host addresses.
- Mixing up the direction of the prefix. A larger prefix means a smaller block: /28 holds 16 addresses, /24 holds 256.
- Expecting /31 to follow the minus-two rule. It gives 2 usable hosts for point-to-point links, and /32 gives 1.
About this calculator
CIDR notation writes an IPv4 subnet as an address followed by a slash and a prefix length (e.g. /24) that tells you how many of the 32 address bits are fixed for the network, leaving the rest for hosts. The block holds 2^(32−prefix) total addresses, but two of those — the network address and the broadcast address — can’t be assigned to a device, so usable hosts equal 2^(32−prefix) − 2 (a /31 or /32 is a special case with no such reservation).
The same prefix length also corresponds to a dotted-decimal subnet mask (a /24 is 255.255.255.0, a /27 is 255.255.255.224, and so on), which routers and operating systems actually use to decide which addresses share a network. Network engineers and system administrators use this conversion constantly when carving a larger network into subnets, sizing a subnet for a given number of devices, or documenting a VLAN’s addressing plan.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
The count is the pure IPv4 maths, but some platforms hold back more addresses than the network and broadcast pair. Amazon's VPC subnets and Azure subnets each reserve five, so a /28 that shows 14 usable hosts here gives 11 usable addresses on those clouds. Check your provider's documentation before sizing a subnet tightly, and leave room to grow. Which platform or equipment do you plan subnets for?