How to Calculate an IPv4 Subnet with an IP Calculator
Updated
Enter an address in CIDR form (for example 192.168.1.10/24) and an IPv4 subnet calculator returns four values you actually need: the network address, the broadcast address, the usable host range, and the subnet mask. On Networking Toolbox this is the IPv4 Subnet Calculator under the Subnetting section. The result is only valid if the prefix length matches the mask you intend to deploy — a /24 and a /25 on the same address produce different networks, so confirm the prefix before you copy anything into a device config.
What the calculator returns
| Output | Meaning | Example for 192.168.1.10/24 |
|---|---|---|
| Network address | First address in the block; identifies the subnet | 192.168.1.0 |
| Broadcast address | Last address; reaches all hosts in the subnet | 192.168.1.255 |
| Usable host range | Addresses you can assign to devices | 192.168.1.1 – 192.168.1.254 |
| Subnet mask | Dotted-decimal form of the prefix | 255.255.255.0 |
The network and broadcast addresses are not assignable to hosts. A /24 holds 256 addresses, but only 254 are usable. Forgetting this is the most common reason a "free" address turns out to be taken.
Step by step
- Get the address and prefix. Note the IP and the CIDR prefix, e.g.
10.0.5.37/26. If you only have a mask like255.255.255.192, convert it first — the CIDR → Mask tool does this in both directions. - Enter them into the IPv4 Subnet Calculator. Input the address and prefix as one string.
- Read the four outputs. Network address, broadcast address, host range, mask.
- Verify before using. Check that the address you typed falls inside the returned host range. If it doesn't, you either mistyped the prefix or the address belongs to a different subnet.
- Reuse the mask. Apply the returned mask to every device in that subnet; a mismatched mask between two hosts on the same wire causes intermittent, hard-to-diagnose failures.
CIDR prefix to mask, and back
The prefix is the count of leading 1 bits in the mask. Each octet is 8 bits, so the mapping is mechanical:
| Prefix | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /30 | 255.255.255.252 | 4 | 2 |
Usable hosts = total addresses − 2 (network + broadcast). This holds for every prefix except /31 and /32, which are special cases used for point-to-point links and single hosts.
Choosing a prefix from a host count
Work backwards from the number of devices you need to address:
- Need 50 hosts → the smallest block with ≥ 50 usable is
/26(62 usable). A/27gives only 30, so it fails. - Need 2 hosts on a router-to-router link →
/30is the standard fit. - Need 200 hosts →
/24(254 usable).
Round up to the next larger block, never down. If you expect growth, size for the future count now — resizing a live subnet means re-addressing every host in it.
Splitting one range into several
When a single large block must serve multiple segments of different sizes, use the VLSM Calculator or Subnet Planner rather than splitting by hand. VLSM lets each sub-subnet take a different prefix length, so a /24 can become a /26 for a 50-host LAN, a /27 for a 30-host segment, and /30s for the links between them — without wasting a full /24 on each.
Related tools in the same section handle the rest of the workflow:
- Supernet Calculator — combine adjacent subnets into one summary route.
- IP Range to CIDR — turn a start/end pair into the CIDR blocks that cover it.
- CIDR Summarizer — collapse a list of prefixes into the fewest possible entries.
- Next Available Subnet / Free Space Finder — locate the next unallocated block in an existing plan.
When the result looks wrong
- Address not in the host range. You likely used the wrong prefix. Recheck whether the mask is
/24or/25— one bit changes the whole block boundary. - Two hosts can't reach each other. Compare their masks. Same-looking addresses with different prefixes can sit in different subnets.
- IPv4 vs IPv6 confusion. A
/64in IPv6 is not comparable to a/24in IPv4. Use the IPv6 Subnet Calculator for v6 addresses; the host-count math is entirely different. - "Usable" count off by two. You're counting the network and broadcast addresses. They are reserved.
Once the four outputs are confirmed, the mask and host range can be copied straight into your addressing plan or device configuration.