Subnet calculator
Calculate a network, understand the bits, and plan your subnets. Each tool explains both the result and how to get there.
1. Understand an IPv4 subnet
An IPv4 address has 32 bits. The prefix (the number after /) tells you how many identify the network. The remaining bits identify addresses within it.
Recent calculations, kept in this browser only
| Result | Value | What it means |
|---|
How this result is calculated
See the binary calculation
Each group is an 8-bit octet. A mask has consecutive 1s for network bits, followed by 0s for host bits. AND keeps a bit only when both inputs are 1.
| Value | Binary |
|---|
For example, 10 AND 0 = 0 in the last octet of a /24 mask, so 192.168.1.10 belongs to 192.168.1.0/24.
2. Find a subnet size for your hosts
Use this when you know how many addresses you need. Count every interface that needs an IP, including gateways, and allow for growth. This tool sizes conventional LAN subnets, reserving one network and one broadcast address.
Why this prefix?
This chooses a size, not an address block. Use the planner below to place it inside a parent network.
3. Split into equal-size subnets
Use equal-size splitting when each segment needs the same capacity. A longer prefix borrows host bits to identify more networks. Every extra bit doubles the number of subnets and halves the addresses in each one.
How the split works
| Network / CIDR | Mask | First host | Last host | Broadcast | Total | Usable |
|---|
4. Plan different-size subnets (VLSM)
Variable Length Subnet Masking gives each segment a size matched to its host requirement. It can save address space compared with giving every segment the largest subnet size.
How allocation works
- For each request, add two reserved addresses, then round up to a power of two.
- Place the largest blocks first, starting at the parent network. This keeps subsequent blocks aligned without overlaps.
- Stop with an error if the combined blocks do not fit. Labels keep the original input order.
| Subnet | Network / CIDR | Requested | Usable | Host range |
|---|
Remaining addresses are unallocated space, not a count of usable hosts in a future subnet. Each new LAN subnet also needs its own network and broadcast addresses.
5. Test whether an address is in a subnet
Use this when checking an access list, a firewall rule, or a host that cannot reach its gateway. The answer comes from the block's first and last address, so a /8 is tested as quickly as a /30 and no list of addresses is ever built.
How this is decided
| Result | Value |
|---|
6. Compare two networks
Use this when planning address space or chasing a routing conflict. Two valid CIDR blocks can only be separate, identical, or one inside the other. They cannot half-overlap, because every block begins on a boundary that is a multiple of its own size.
What this means
| Block | Range | Total addresses |
|---|
7. Turn an address range into CIDR blocks
Tool 1 already goes the other way, turning a block into its range. This goes from a plain start and end address back to CIDR. Not every range is one block: a block must begin on a boundary that is a multiple of its own size, so a range starting or ending off a boundary needs several.
How the blocks are chosen
| Block | Range | Total addresses |
|---|
8. Summarize several networks
Summarizing replaces several routes with one shorter prefix. The risk is quiet: the covering block often takes in address space nobody asked for, and advertising it claims that space too. This tool always shows what the summary would pull in.
What the summary covers
| Block | Range | Total addresses |
|---|