Utilities

Subnet Calculator

Calculate network ranges, subnet masks and available IP addresses.

Processed in your browser

The Subnet Calculator shows what a chosen IPv4 network looks like before you configure it. Enter a block in CIDR notation, such as 192.168.1.0/24, and it returns the subnet mask, the range of addresses you can assign, the broadcast address and the number of usable addresses.

The usual reason to open it is a planning question: how large a subnet an office needs, where one subnet ends and the next begins, or whether two ranges collide.

Everything is calculated in your browser, and the page shows "Processed in your browser". Nothing you enter is sent to the IP Tracker server. IPv4 Calculator runs the same calculation, and its guide explains the binary arithmetic behind the rows.

How to use the subnet calculator

  1. Decide on a candidate block, for example 192.168.10.0/26. The number after the slash is the prefix length, and a larger number means a smaller network.
  2. Type the block into the field and click Calculate.
  3. Compare Usable addresses with the number of devices you have to fit.
  4. Write down the Network and Broadcast rows. A subnet of the same size can start at the address right after the broadcast address.
  5. If the size is wrong, change the prefix and calculate again.

Any address inside the block works as input. If you type 192.168.10.200/27, the Network row shows 192.168.10.192/27, the block that address falls in.

The input has to be an address, a slash and a prefix length. Without the slash and prefix, the page shows "Use IPv4 CIDR notation, for example 192.168.1.0/24."

How to read the result

RowWhat it tells you when planning
NetworkThe name of the block, as you would write it in documentation, a routing entry or a firewall rule
Subnet maskThe value to type into a device or DHCP server that asks for a mask instead of a prefix
Wildcard maskThe inverted mask that some router access lists expect
BroadcastThe last address of the block. It is not assigned to a device
First usableThe lowest address you can assign. Many networks give it to the router
Last usableThe highest address you can assign
Total addressesThe size of the block, always a power of two
Usable addressesHow many devices the block can hold
BinaryThe bits of the address you typed

For 192.168.1.0/24 the result is network 192.168.1.0/24, mask 255.255.255.0, wildcard 0.0.0.255, broadcast 192.168.1.255, first usable 192.168.1.1, last usable 192.168.1.254, 256 addresses in total and 254 usable.

Giving the router the first usable address is a habit, not a rule. Any usable address can be the gateway, as long as every device in the subnet is told the same one.

A DHCP server (the service that hands out addresses automatically) needs a pool that lies between First usable and Last usable. Leave part of the range outside the pool for devices with fixed addresses, such as the router, printers and servers.

Choosing a prefix for a number of devices

Count every device that needs an address. Computers are the obvious ones, but phones, printers, cameras, wireless access points and the router itself each take one as well. Add two for the network and broadcast addresses, then pick the smallest block that is at least that large. Block sizes are powers of two, so there are only a few sizes to choose from.

PrefixSubnet maskTotal addressesUsable addresses
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

A group of 50 devices needs 52 addresses once the two reserved ones are added. With 32 addresses, a /27 is too small. The smallest fit is a /26, which has 64 and leaves 12 spare.

Larger blocks follow the same pattern. Each step to a shorter prefix doubles the size: a /23 has 512 addresses and a /22 has 1,024.

Splitting a /24 into smaller subnets

Adding one bit to the prefix cuts a block into two halves. A /24 holds two /25 blocks, four /26 blocks, eight /27 blocks or sixteen /28 blocks. This is 192.168.10.0/24 cut into four equal parts.

SubnetUsable rangeBroadcast
192.168.10.0/26192.168.10.1 to 192.168.10.62192.168.10.63
192.168.10.64/26192.168.10.65 to 192.168.10.126192.168.10.127
192.168.10.128/26192.168.10.129 to 192.168.10.190192.168.10.191
192.168.10.192/26192.168.10.193 to 192.168.10.254192.168.10.255

The parts do not have to be equal. Suppose an office needs about 100 addresses for staff, 50 for guests, 20 for printers and 10 for servers. Working from the largest group down keeps the blocks aligned.

UseDevicesSubnetUsable addresses
Staff100192.168.10.0/25126
Guests50192.168.10.128/2662
Printers20192.168.10.192/2730
Servers10192.168.10.224/2814
Spare0192.168.10.240/2814

A subnet can only start at a multiple of its own size. A /26 in this block starts at 0, 64, 128 or 192, never at 100. The calculator shows this directly: enter the address you had in mind with the prefix, and the Network row shows where that block really begins.

Why two addresses are lost in every subnet

The first address of a block identifies the network itself. The last address is the broadcast address: a packet sent to it is delivered to every device in the subnet. Neither is assigned to a device, so a block of 64 addresses has 62 usable ones.

The cost grows as subnets shrink. Cutting a /24 into sixteen /28 blocks leaves 14 usable addresses in each, 224 in all, where the undivided /24 had 254.

Two prefix lengths are exceptions. A /31 has only two addresses. On a link that joins exactly two routers there is nobody else to broadcast to, so both addresses are used for the two ends, and the calculator reports 2 total and 2 usable. Before this was accepted, such links used a /30, which spends four addresses to connect two devices. Check that both devices support a /31 before you rely on it.

A /32 is one address with no network around it. It shows 1 total and 1 usable. You meet it in firewall rules and allow lists that name a single host, such as 203.0.113.5/32, and in routing entries for one address.

Leaving room to grow

A subnet sized to the exact number of devices today is full as soon as one more arrives. Changing the prefix later means changing the mask on every device with a fixed address, the DHCP settings and every firewall rule that mentions the block. Choosing one size larger at the start usually costs nothing inside a private range.

Where you leave the spare space matters as well. Two blocks can be merged into one larger block only if they are its two halves. 192.168.10.128/26 and 192.168.10.192/26 combine into 192.168.10.128/25. 192.168.10.64/26 and 192.168.10.128/26 sit next to each other but cannot be merged, because no /25 starts at 64. If you expect a subnet to double, keep its other half free.

Think about what the network will connect to. Home routers very often use 192.168.0.0/24 or 192.168.1.0/24. An office that uses the same range runs into trouble when staff connect from home over a VPN, because their computer then sees the same addresses on both sides. Picking a less common part of the private ranges avoids that.

Some cloud providers reserve a few extra addresses in every subnet for their own use, so the usable count there is lower than the one shown here. Check the documentation of the platform before sizing a small subnet.

Planning problems the calculator helps with

  • Two subnets may overlap. Calculate both and compare the span from Network to Broadcast. If the spans share any address, traffic for those addresses can go to the wrong place.
  • A DHCP pool runs past the end of the subnet. Compare the last address of the pool with the Last usable row.
  • A device with a fixed address cannot reach its gateway. Enter the device address with its prefix, then the gateway address with the same prefix. Both must show the same Network row.
  • A firewall rule is wider than intended. Total addresses shows how many addresses a rule for that block really covers. A rule for a /16 covers 65,536 of them.
  • A provider gives you a small public block such as a /29. The result shows its 6 usable addresses, one of which is often taken by the gateway.
  • A database or log stores ranges as numbers. Convert the Network and Broadcast addresses with IPv4 to Decimal to get the first and last value of the block.

What the subnet calculator does not do

It calculates one block at a time. It does not produce the list of subnets for a split, find the smallest block that covers several ranges, or compare two blocks for you.

Only IPv4 is supported. IPv6 subnets are planned differently, since a single IPv6 subnet is normally a /64 with far more addresses than devices.

The result describes the arithmetic of a block, not your real network. It cannot tell you which addresses are already taken or whether the block is free to use. For a public address, IP WHOIS shows who the range is registered to.

Frequently asked questions

What prefix do I need for 100 devices?

A /25. It has 128 addresses, of which 126 are usable. A /26 has only 62 usable addresses, which is too few.

If the group is likely to grow past 126, go straight to a /24 with 254 usable addresses.

How many subnets can I make from a /24?

It depends on the size of each one. A /24 divides into 2 blocks of /25, 4 of /26, 8 of /27, 16 of /28, 32 of /29 or 64 of /30.

You can also mix sizes, as long as each block starts at a multiple of its own size and no two blocks overlap.

Which is bigger, a /24 or a /28?

The /24. The prefix length counts the bits used for the network part, so a smaller number leaves more bits for devices. A /24 has 256 addresses and a /28 has 16.

Why does a /30 have only two usable addresses?

A /30 has four addresses. The first is the network address and the last is the broadcast address, which leaves two for devices. It was long the usual size for a link between two routers.

Can I use a /31 subnet?

Yes, on a point-to-point link, meaning a link with exactly two devices on it. Both addresses are assigned and there is no separate network or broadcast address. The calculator shows 2 usable addresses for a /31.

It is not suitable for an ordinary network with several devices, and older equipment may not accept it.

What is a /32 used for?

A /32 describes exactly one address. It is used wherever a setting expects a block but you mean a single host, for example an allow list entry or a route to one machine.

How do I check whether two subnets overlap?

Calculate both and write down the Network and Broadcast address of each, then put the two in order of their Network address. They overlap if the second one starts at or before the Broadcast address of the first. 192.168.10.0/25 runs from 192.168.10.0 to 192.168.10.127, so it overlaps 192.168.10.64/26, which starts at 192.168.10.64.

Two correctly aligned blocks either do not touch at all or one lies completely inside the other.

Is the Subnet Calculator different from the IPv4 Calculator?

No. Both pages take the same input and show the same rows. The guides differ: this one covers planning, and the guide on IPv4 Calculator explains the arithmetic.