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.

Try 172.25.10.54/21 or 192.168.1.10 255.255.255.0. Leading zeros in octets are not accepted.

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.

Enter a whole number from 1 to 4,294,967,294. The smallest LAN subnet offered here is /30.

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.

Use a prefix from the parent's length through 32, with or without a slash. Maximum 256 output subnets. A host address is normalized to its parent network.

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.

Separate counts with commas. Include gateways and growth in each count. Up to 256 subnets; conventional LAN sizing only (minimum /30). The parent is normalized to its network boundary.

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.

The subnet takes a prefix or a dotted mask and may be written from any address inside it. The address to test is a plain IPv4 address.

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.

Each network takes a prefix or a dotted mask. Both are normalized to their network boundary before being compared.

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.

Plain IPv4 addresses, no prefix. The start must not be higher than the end. The result is the smallest set of blocks covering the range exactly, never more and never less.

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.

Separate networks with commas. Each accepts a prefix or a dotted mask. Between two and 64 networks.