Calculate the network, broadcast, usable range, masks and host count for a CIDR block, with /31 and /32 handled correctly.
Subnet Calculator
Work out subnet boundaries, masks and host capacity from an address and prefix length.
- Free
- No sign-up
- Runs in your browser
Input
Ready
Everything happens on this device. No upload, no account, no network request.
How to use this tool
- 1
Enter an address with its prefix length. A host address works as well as a network address.
- 2
The subnet it belongs to is computed, along with the usable range and host capacity.
Questions about Subnet Calculator
I entered a host address, not a network. Is that a problem?
No - the network address is computed for you and the result says so. That is usually what you want: given an interface address and its prefix, you learn which subnet it belongs to.
How many hosts does each prefix give?
Two to the power of the remaining bits, minus two for the network and broadcast addresses: a /24 gives 254, a /25 gives 126, a /30 gives 2. The exceptions are /31 (two usable, RFC 3021) and /32 (one, a host route).
Is my data sent anywhere?
No. This tool runs as JavaScript inside your browser tab. There is no network request carrying your input, nothing is written to a server log, and it keeps working with your connection switched off. You can confirm it in the browser’s network panel. That matters more here than elsewhere on the site: developer tools handle tokens, keys and production data.
Does the Subnet Calculator work offline?
Yes. Once the page has loaded it runs entirely as JavaScript on your own device, so the Subnet Calculator keeps working with the network switched off and nothing is ever sent to a server.
Is anything I enter into the Subnet Calculator uploaded or stored?
No. The Subnet Calculator runs in your browser, so whatever you type or paste never leaves your device — there is no server round-trip, nothing is logged, and there is nothing to delete afterwards.
Related tools
Other tools you might reach for next.
Validate an IPv4 address and show its decimal, hexadecimal and binary forms with its RFC-defined scope.
Validate an IPv6 address and show its canonical RFC 5952 form, full expansion and scope.
Convert an IPv4 address between dotted decimal, 32-bit integer, hexadecimal, binary and IPv4-mapped IPv6.
Format and indent JSON, with optional alphabetical key sorting and a precise syntax error when it will not parse.
Strip every byte of insignificant whitespace from JSON and report the saving.
Check that JSON is syntactically valid, report its structure, and flag duplicate keys that JSON.parse accepts silently.
Compare two JSON documents structurally, by path, distinguishing a type change from a value change.