IP Subnet Calculator

Results
—
—

The IP Subnet Calculator takes an IPv4 address and a CIDR prefix and derives the subnet mask, network address, broadcast address, wildcard mask, host range, and total and usable host counts.

Formula
mask = ((1 << bits) − 1) << (32 − bits); network = ip & mask; broadcast = network | ~mask

FAQ

Why are only some hosts usable in a subnet?
The network address and the broadcast address are reserved, so usable hosts equal 2^(32−prefix) minus two.

Embed this calculator on your site

Cite this page

About these results

Every calculation on this page runs locally in your browser using published, standard formulas — nothing you enter is sent to a server. Results are estimates for planning purposes and can differ from real-world conditions; always follow your local building code and the advice of a qualified professional for final decisions. You can read more about who builds and maintains these tools on our About page. About MateCalc.

Related Calculators