Subnet calculator (CIDR)
Compute the subnet mask and number of usable hosts from a CIDR prefix.
Related tools
All Web & network tools →Need Subnet mask, Usable hosts? The Subnet calculator (CIDR) derives it from CIDR prefix (/n) in one step. For instance, with CIDR prefix (/n) = 24 it returns Subnet mask = 255.255.255.0 and Usable hosts = 254.
How to use it
- Enter your values: CIDR prefix (/n).
- Read the result instantly: Subnet mask, Usable hosts.
Frequently asked questions
How does the Subnet calculator (CIDR) work?
It takes CIDR prefix (/n) and derives Subnet mask and Usable hosts from them. The calculation is live as you type, so the result updates on every change.
Which values does the calculator ask for?
A single value: CIDR prefix (/n). Nothing else is required — no account, no file upload.
What does a typical calculation look like?
With CIDR prefix (/n) = 24, the calculator returns Subnet mask = 255.255.255.0 and Usable hosts = 254. Those figures come from running this exact tool, so you can reproduce them by entering the same values.
How much does the result change with different inputs?
It moves a lot. Using CIDR prefix (/n) = 48 instead, Usable hosts goes from 254 to 0 — which is why it is worth testing a few scenarios rather than trusting a single figure.
What does it give for smaller values?
Scaled down to CIDR prefix (/n) = 12, Usable hosts comes out at 1,048,574. The relationship is worth checking at both ends before you rely on a single result.
When would I actually use this?
Getting usable data out of something that was never meant to be parsed: pulling every address out of a pasted thread, turning a column of lines into a JSON array or an SQL IN clause, renaming a hundred identifiers from snake_case to camelCase in one pass.
What is the most common mistake?
Trusting an extraction to be exhaustive. A pattern that catches every address in the sample will still miss the one wrapped across a line break, the one written with a display name, and the one an email client turned into a link — count what came out against what you expected before you use the list.
Where do the figures come from, and how current are they?
Extraction runs on patterns, not on a parser: it recognises the common shapes of an address, a URL or an IP rather than validating them against their specification. That is the right trade for a paste, and the wrong one for input you are about to store.