ToolLineup

CIDR / Subnet Calculator

This CIDR subnet calculator works out everything that follows from an IPv4 address and a prefix length: the network and broadcast addresses, the first and last usable host, the subnet and wildcard masks, the mask in binary, and how many addresses the block holds. It then lists every available address page by page, and the addresses in the block that cannot be assigned to a host, with the reason. You can also check one address to see whether it is free to use, or download the whole list. The two exceptions to the usual rules are handled properly rather than glossed over — a /31 is a point-to-point link with two usable addresses and no broadcast address at all, and a /32 is a single host route. Both are cases where the familiar subtract-two rule gives the wrong answer. For IPv6 blocks there is a separate IPv6 subnet calculator.

How it works

Enter an IPv4 address with a prefix length, such as 192.168.1.0/24. It works out the network and broadcast addresses, the usable host range, the subnet and wildcard masks and how many addresses the block holds, then lists every available address and every address that cannot be assigned, with the reason.

The two exceptions to the usual rules are handled properly. A /31 is a point-to-point link with two usable addresses and no broadcast address, and a /32 is a single host — both of which the "subtract two" rule gets wrong.

Everything runs in your browser — nothing you enter is sent to a server.

What the prefix means

The number after the slash is how many leading bits identify the network. The rest identify the host. A /24 fixes the first 24 bits, leaving 8 bits — 256 addresses — for hosts.

Every step down the prefix doubles the block:

PrefixMaskAddressesUsable
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/24255.255.255.0256254
/16255.255.0.065,53665,534

The two exceptions

/31 — defined by RFC 3021 for point-to-point links. Both addresses are usable and there is no broadcast address, because a link with exactly two ends has no need to broadcast. The subtract-two rule would say zero usable hosts, which is wrong.

/32 — a single address. Used for host routes, loopback interfaces and firewall rules that target one machine.

Available and not-available addresses

Below the results the calculator lists every address you can give to a host, a page at a time, and the addresses in the block you cannot: the network address (the first, which names the subnet itself) and the broadcast address (the last, which reaches every host at once). To check a single address, type it into Check an address — it says whether the address is available, reserved or outside the block, and jumps the list to it.

Wildcard masks

A wildcard mask is the bitwise inverse of the subnet mask, and it is what Cisco access lists and OSPF expect. It is easy to mistake one for the other, and doing so silently matches the wrong range — which is why both are shown here side by side.

Working with IPv6? It has no broadcast address and reserves different addresses, so it has its own IPv6 Subnet Calculator.

Frequently asked questions

How do I use the subnet calculator?

Enter an address and prefix in CIDR form, such as 192.168.1.0/24. The network, broadcast, host range, masks and address counts are worked out immediately, with the available and not-available addresses listed underneath.

Why is the usable count two fewer than the total?

The first address identifies the network and the last is the broadcast address, so neither can be assigned to a host. A /24 holds 256 addresses and 254 usable ones.

What about a /31?

A /31 is the exception. Defined for point-to-point links, it has two usable addresses and no broadcast, because a link with exactly two ends does not need one. A /32 is a single host, and nothing in either is reserved.

Can it list every usable address?

Yes, page by page, for any block size, and blocks of up to 65,536 usable addresses can be downloaded as one text file. The Not available tab lists the network and broadcast addresses.

How do I check whether one address is free to use?

Type it into Check an address. The tool says whether it is available, reserved (and why), or outside the block, and can jump the list to the page that contains it.

What is a wildcard mask?

The inverse of the subnet mask, used by Cisco access lists and OSPF. A /24 has subnet mask 255.255.255.0 and wildcard mask 0.0.0.255.

Can I enter a host address rather than the network?

Yes. Enter any address in the block and the network is worked out from the prefix. The tool notes when the address you gave is a host rather than the network address.

Does it handle IPv6?

IPv6 has its own calculator, the IPv6 Subnet Calculator, because the rules differ: there is no broadcast address, the reserved addresses are anycast ones, and the counts run to 39 digits.

Is anything sent to a server?

No. The calculation is arithmetic and runs entirely in your browser.

Related tools