Skip to content
OneKitly

Subnet calculator (CIDR)

Compute the subnet mask and number of usable hosts from a CIDR prefix.

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

  1. Enter your values: CIDR prefix (/n).
  2. 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.

Further reading

All guides
ExplainerHow Subnet Masks Work: CIDR, Network Bits, and Usable HostsUnderstand how a subnet mask splits an IP address into network and host parts, what /24 means, and how to count usable hosts.How-toHow to Read Binary and Convert It to Decimal and HexLearn how binary place values work and convert binary to decimal and hexadecimal by hand, with clear worked examples.GuideSecuring a Home Wi-Fi Network: the Key, the Protocol and the Guest NetworkThe generator's random source audited line by line, what SAE actually removes, why transition mode gives most of it back, and the thing every guest-network guide leaves out.GuideHTTP Status Codes Explained: The Ones That Actually Get Confused301 against 308, 302 against 307, 401 against 403, 404 against 410 — plus what Retry-After on a 429 or a 503 actually promises. The pairs where picking the wrong code changes behaviour, not just wording.How-toHow to Write a Cron Expression: Five Fields and the OR Rule Nobody MentionsMinute, hour, day of month, month, day of week. The traps are that a step is a stride through a range and not an interval, and that the two day fields are combined with OR — so 0 0 1 * 1 fires on the 1st and on every Monday.ExplainerHow Unix File Permissions Work: Reading 755 Without GuessingRead is 4, write is 2, execute is 1, and each of the three digits describes a different party. The part most explanations get wrong is what the execute bit does on a directory — it grants traversal, not the right to run anything.