Work out subnet boundaries, masks and host capacity from an address and prefix length.
CIDR Calculator
Calculate the network, broadcast, usable range, masks and host count for a CIDR block, with /31 and /32 handled correctly.
- Free
- No sign-up
- Runs in your browser
Input
An address and prefix length. A bare address is treated as /32.
Ready
Everything happens on this device. No upload, no account, no network request.
How to use this tool
- 1
Enter a block in CIDR notation. A bare address is treated as /32.
- 2
Every derived value is shown: network, broadcast, first and last usable host, both masks, and the total and usable counts.
- 3
Calculated in your browser. No lookup is performed and nothing is transmitted.
Questions about CIDR Calculator
Why does a /31 show two usable hosts rather than zero?
Because the usual "total minus two" rule does not apply. RFC 3021 defines /31 for point-to-point links, where both addresses are usable and there is no broadcast address. A calculator that subtracts two reports zero usable hosts, which is wrong - and /32 similarly is a single host route, not minus one.
What is the wildcard mask for?
It is the bitwise inverse of the subnet mask, and it is what Cisco access control lists use instead of a netmask. A /24 has mask 255.255.255.0 and wildcard 0.0.0.255.
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 CIDR Calculator work offline?
Yes. Once the page has loaded it runs entirely as JavaScript on your own device, so the CIDR Calculator keeps working with the network switched off and nothing is ever sent to a server.
Is anything I enter into the CIDR Calculator uploaded or stored?
No. The CIDR 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.