IP Subnet CalculatorFree online other calculator — instant results, no sign-up
Network, broadcast and host range of an IPv4 subnet.
Sign in to save results and favorites.
About the IP Subnet Calculator
The IP Subnet Calculator determines the network address, broadcast address, subnet mask, usable host range, and total number of usable host addresses for an IPv4 address under a given CIDR prefix. Network engineers, system administrators, and students use it to plan IP allocations and troubleshoot routing boundaries. It processes standard dotted-decimal IPv4 addresses alongside classless prefix lengths.
- IP address
- A standard 32-bit IPv4 address written in dotted-decimal format (four octets separated by periods, with each octet between 0 and 255, such as 192.168.1.10).
- Prefix length (CIDR)
- The number of continuous leading network bits in the subnet mask, typically ranging from 0 to 32.
Formula and method
Subnet Mask = (~0 << (32 − c)) >>> 0 Network Address = (IP AND Subnet Mask) >>> 0 Broadcast Address = (Network Address OR NOT Subnet Mask) >>> 0 Usable Hosts = max(0, 2^(32 − c) − 2) Usable Host Range = (Network Address + 1) to (Broadcast Address − 1)
- cCIDR prefix length (number of network bits)
- IP32-bit integer representation of the input IPv4 address
- Subnet Mask32-bit integer with c leading 1-bits and 32 − c trailing 0-bits
- Network AddressLowest numeric address in the block, reserved to identify the network
- Broadcast AddressHighest numeric address in the block, reserved for broadcast traffic to all hosts
The calculator parses the dotted-decimal IP address into a 32-bit unsigned integer and converts the prefix length into a 32-bit subnet mask bitmask. It uses bitwise AND to isolate the network address and bitwise OR with the inverted mask to calculate the broadcast address. The usable host count is calculated using the formula 2^(32 − c) − 2, floored at 0, and converted back to standard dotted-decimal notation for display.
Worked example
These are the calculator's starting values and the results it actually produces for them.
Inputs
- IP address192.168.1.10
- Prefix length (CIDR)24
Results
- Network192.168.1.0
- Broadcast192.168.1.255
- Subnet mask255.255.255.0
- Usable hosts254
- Host range192.168.1.1 – 192.168.1.254
How to use the IP Subnet Calculator
- 1Verify the IP address contains four octets between 0 and 255, then pack them into a 32-bit unsigned integer.
- 2Derive the 32-bit subnet mask by shifting 32 minus the CIDR prefix length.
- 3Compute the network address by taking the bitwise AND of the IP and mask, and compute the broadcast address by taking the bitwise OR of the network address and the inverted mask.
- 4Calculate the usable host capacity and format the network, broadcast, mask, and usable host range (network + 1 through broadcast − 1) into dotted-decimal strings.
Reading your result
The Network and Broadcast addresses represent the boundaries of the subnet and are generally not assigned to individual endpoint interfaces. The Usable hosts count indicates how many distinct devices can receive unique IPs within this subnet, spanning inclusively across the displayed Host range. The Subnet mask shows the standard dotted-decimal equivalent of your CIDR prefix length.
Limitations
This calculator only supports IPv4 addresses and does not parse IPv6 addresses. For prefix lengths of /31 and /32, it applies the standard subtraction formula resulting in 0 usable hosts, and it does not account for RFC 3021 point-to-point links (/31) where two hosts are usable. It also does not validate whether the entered IP falls into public, private, or reserved multicast spaces.
Common questions
Why are two addresses subtracted when calculating usable hosts?+
What happens if I enter a /31 or /32 CIDR prefix?+
What does CIDR stand for?+
Does the calculator save my information?+
Calculations run in your browser. While signed in, inputs and results are automatically recorded in account history; saving a result creates a separate saved record.
You might also like
Password Generator
Create a strong random password.
Voltage Drop Calculator
Voltage drop on a copper conductor.
GDP Calculator
GDP by the expenditure approach.
Horsepower Calculator
Horsepower from torque and RPM.
Engine Horsepower Calculator
Estimate horsepower from weight and quarter-mile time.
Resistor Calculator
Series and parallel resistance (values separated by commas).
Results are estimates for informational purposes and are not financial, medical or legal advice.