Subnet and CIDR calculator

Converts a CIDR block into the range it actually covers: the network address, the first and last host, broadcast, netmask and wildcard, and the total and usable address counts. IPv4 and IPv6 are both accepted, and nothing is sent to the network — the answer is arithmetic on exactly what you typed.

Active tool

Subnet and CIDR calculator

Ready

Need another tool?

Pick one of the 25 below

What the subnet calculator computes

The subnet calculator turns a CIDR block into the range it covers: network address, first and last host, broadcast, netmask and wildcard, host bits, and the total and usable address counts. It accepts IPv4 and IPv6, a prefix such as 10.0.0.0/8 or 2001:db8::/32, a bracketed IPv6 address, or a bare address read as a host route.

Nothing leaves the server: no resolver, no socket, no third party. The answer is arithmetic on exactly what you typed, so the only thing that can be wrong with it is the input, and the parser is strict on purpose: a leading zero, a decimal or a space in the prefix is refused rather than guessed at. Because it costs no network it is billed to the ordinary budget of 120 requests a minute.

How to read the result

The headline is the normalised block, so 192.168.1.77/24 comes back as 192.168.1.0/24, with the usable count and the span from first to last host beneath it. Range repeats those with the total; for IPv4, Mask adds netmask, wildcard, broadcast and host bits. Where the block can be halved, the two halves are listed. A reserved block carries a note that it is not routed on the public internet.

Usable-host counting is where calculators disagree. A /32 or /128 is one host. A /31 is a point-to-point link under RFC 3021, so both addresses are usable and broadcast shows a dash; /127 is the same under RFC 6164. Other IPv4 blocks lose the network and broadcast addresses; IPv6 has no broadcast and sets aside only the subnet-router anycast address. Counts too long to read are written as a power of two.

When it is useful

Before writing a firewall rule or an nginx allow directive: paste the block, read the first and last address, and check that the range you are about to open is the one you meant. A /22 that was supposed to be a /24 is the classic mistake, and here it shows as four times the addresses.

When splitting an allocation between two sites or VLANs, the halves are already listed. The CIDR from a WHOIS lookup of an address pastes straight in, and whether a given host falls inside a block is read off the first and last host without any binary.

Common questions

How many usable hosts does a /24 have?

254. A /24 holds 256 addresses; the first is the network address and the last is broadcast, and neither can be given to a host.

Why does a /31 show two usable hosts and no broadcast?

RFC 3021 defines a /31 as a point-to-point link with no network or broadcast address, so both addresses are hosts. The broadcast row shows a dash rather than repeating the last address as if it were one.

Does the subnet calculator work for IPv6?

Yes, any prefix from /0 to /128. There is no broadcast in IPv6, so no mask section, and counts longer than twelve digits are written as a power of two with the exact figure in the raw response.

Is anything sent to the network?

No. The calculation runs on the server from the text you typed and opens no connection, which is why the tool sits in its own group apart from the tools that send packets.

Limits. The DNS, WHOIS and SSL tools allow up to 20 requests a minute per IP address. Ping, traceroute and MTR send real packets to their target, so they allow 6 a minute.

The port check runs only against your own IP address. That is deliberate: the question people actually have, "is this port reachable from outside?", is answered by it, while this server cannot be used to scan anyone else's network.

Private and reserved addresses. These are refused by the tools that really connect to their target: the SSL check, ping, traceroute, MTR and the port check. The DNS tools have no such limit, because they only ask a nameserver a question and never connect to the address itself.