Tip: click any value to copy it.
About this tool
A subnet calculator takes an IP address and a prefix length (or dotted netmask) and works out the boundaries of the network it belongs to: the network and broadcast addresses, the usable host range, the netmask and wildcard mask, and how many hosts the subnet can hold. It is essential when planning address space, configuring routers and firewalls, or sizing a VPC.
This tool handles both IPv4 and IPv6 — it auto-detects the family from the address — and does the math with exact big-integer arithmetic, so even a /8 or a sprawling IPv6 range is computed precisely. The special cases /31 (point-to-point) and /32 (single host) are handled correctly. Click any result value to copy it. Everything runs in your browser.
All subnet math runs locally in your browser — nothing is sent to a server.
Frequently asked questions
Can I enter a dotted netmask instead of a prefix?
Yes — for IPv4 you can type either a prefix length (like 24) or a dotted netmask (like 255.255.255.0). The tool validates that the mask bits are contiguous and converts it to the equivalent prefix.
Why do /31 and /32 show no usable hosts the usual way?
A /32 describes a single host and a /31 is a two-address point-to-point link (per RFC 3021), so the conventional "subtract network and broadcast" rule does not apply. The calculator accounts for these edge cases.
Does it support IPv6?
Yes. Enter an IPv6 address (with :: shorthand if you like) and a prefix, and it returns the network, first and last addresses and the total address count for that range.