Subnet Calculator

Calculate network address, broadcast, host range, and mask from an IPv4/CIDR.

This tool runs entirely in your browser. Your files are never uploaded to a server.

Network Address192.168.1.0
Broadcast Address192.168.1.255
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Total Addresses256
Usable Hosts254

What this tool does

Calculates the full set of IPv4 subnet details from an address and a CIDR prefix — network address, broadcast address, subnet mask, wildcard mask, first and last usable host, total address count, and usable host count.

How to use it

Enter an IPv4 address in dotted-decimal form and a CIDR prefix from 0 to 32. Every result field updates immediately as you change either value; an invalid address shows an error message instead of a table.

Worked example

With the default 192.168.1.10 and a /24 prefix, the network address is 192.168.1.0, the broadcast address is 192.168.1.255, the subnet mask is 255.255.255.0, the wildcard mask is 0.0.0.255, the first usable host is 192.168.1.1, the last usable host is 192.168.1.254, the total address count is 256, and the usable host count is 254.

How the special /31 and /32 cases work

A /32 prefix describes a single host: there's no separate broadcast address, and the usable host count is 1. A /31 prefix is treated as a point-to-point link per RFC 3021: both addresses in the pair are counted as usable hosts, with no network/broadcast split, giving a usable host count of 2 even though normal subnets would reserve the top and bottom address.

Formula

The subnet mask is built by setting the top prefix-length bits to 1; the wildcard mask is its bitwise complement. The network address is the input address bitwise-ANDed with the mask, and the broadcast address is the network address bitwise-ORed with the wildcard mask. Total addresses is 2 raised to the power of (32 minus the prefix); usable hosts is that number minus 2 for any prefix under 31.

Limitations

This calculator only supports IPv4 — IPv6 uses a completely different addressing scheme and prefix notation and isn't covered here. It also only validates the syntax of the address you enter (four numbers from 0 to 255, separated by dots); it doesn't check whether that address is actually routable, assigned, or reachable on any network.

Privacy and processing

Every calculation runs locally in your browser using plain bitwise arithmetic. The address you enter is never sent to a server.

Frequently Asked Questions

Does this support IPv6?
No, this calculator handles IPv4 addresses and CIDR prefixes only — IPv6 subnetting uses a different addressing scheme and isn't covered here.
How are /31 and /32 handled?
They're handled as special cases: a /32 is a single host with no separate network or broadcast address, and a /31 is a point-to-point link where both addresses are usable hosts with no broadcast split.
What's the difference between total and usable addresses?
Total addresses is every address in the range, while usable host count excludes the network and broadcast addresses (except in the /31 and /32 special cases), since those two aren't assignable to hosts.