Subnet Calculator
Work out an IPv4 subnet from IP and prefix.
Result
How it is calculated
An IPv4 address has 32 bits. The CIDR prefix /p says the first p bits identify the network and the remaining 32 − p bits identify the host. The netmask is p ones followed by zeros. The network address is IP AND mask (host bits set to 0), the broadcast address is the network address with all host bits set to 1, and usable hosts are 232 − p − 2, because the network and broadcast addresses cannot be given to devices. The tool needs four octets from 0 to 255 and a prefix from 0 to 32. For /31 it shows 2 usable addresses (RFC 3021, point-to-point links, where there is no network or broadcast address to give up) and for /32 one host.
Worked example
Address 192.168.10.37 with prefix /26. Mask: 26 ones = 255.255.255.192. The last octet block size is 256 − 192 = 64, and 37 falls in the block 0–63. Network: 192.168.10.0. Broadcast: 192.168.10.63. Usable hosts: 26 − 2 = 62, from .1 to .62.
Common mistakes
- Counting the network and broadcast addresses as usable hosts. A /26 holds 64 addresses but only 62 hosts.
- Confusing the prefix with the number of hosts. A larger prefix like /30 means a smaller network.
- Entering the mask (255.255.255.0) in the prefix field. Give the CIDR number, here 24.
- Expecting the address you typed to be the network address. 192.168.10.37 is a host inside 192.168.10.0/26.
- Assuming /31 has no use. Point-to-point links use both of its addresses (RFC 3021), and the tool shows 2.
Sources
- RFC 4632: Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan — IETF / RFC Editor
- RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links — IETF / RFC Editor
About this calculator
This calculator works out an IPv4 subnet from an IP address and CIDR prefix length: it derives the subnet mask, the network address (IP bitwise-ANDed with the mask), the broadcast address (network address with all host bits set to 1), and the number of usable host addresses (2^(32−prefix) − 2, subtracting the network and broadcast addresses themselves).
Network engineers and system administrators use subnetting constantly when designing IP address plans — carving a larger network into smaller subnets for departments, VLANs, or cloud VPCs, sizing subnets to fit a known number of hosts without wasting address space, and configuring routers and firewalls.
Was this helpful?
You can pick up to 3 reactions.
Comments
- Be the first to comment.
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
Note from the editors
The usable host count subtracts the network and broadcast addresses, except for the two smallest subnets: a /31 shows 2, because on point-to-point router links RFC 3021 lets both addresses be assigned to the two ends, and a /32 shows 1, a single host or loopback. So read those small figures as special-case sizing, not as an error. Are you planning a LAN, a VPN range or a router link?