IPv4 CIDR range calculator
The IPv4 CIDR range calculator turns an address such as 192.168.1.10/24 into the exact boundaries of its subnet.
Run — free
It returns the normalized input address, prefix length, network address, broadcast address, first usable IP, last usable IP, total address count, and usable host count. Strict validation rejects malformed IPv4 addresses and prefixes outside 0 through 32, so the result is suitable for interactive checks, scripts, provisioning workflows, and configuration reviews.
Enter an address with its CIDR prefix
Provide one dotted-decimal IPv4 address, a slash, and a prefix length, for example 192.168.1.10/24. The address may be any member of the subnet; it does not need to be the network address. The calculator validates all four octets independently, requiring decimal values from 0 through 255, and it accepts prefix lengths from 0 through 32. It rejects shortened addresses, extra octets, signs, embedded spaces, leading-zero octets, nonnumeric prefixes, and multiple slashes instead of guessing what the caller intended. This strict behavior matters in automation because a permissive parser can silently reinterpret a typo and produce a convincing range for the wrong address. After validation, the prefix determines how many high-order bits identify the network. The remaining bits identify positions inside that network. The input address is masked to the correct boundary, so entering 192.168.1.203/24 correctly produces a network beginning at 192.168.1.0 rather than treating the supplied host as the start.
Understand the returned network boundaries
The network address is the lowest address in the CIDR block, with every host bit set to zero. The broadcast address is the highest address, with every host bit set to one. For ordinary prefixes from /0 through /30, the first usable IP is one address above the network and the last usable IP is one below the broadcast. Those two boundary addresses are reserved for identifying the subnet and reaching every host on it, so they are excluded from the usable host count. The response also includes total_addresses and usable_hosts, which makes capacity checks possible without doing separate exponent arithmetic. A /24 contains 256 total addresses and 254 conventionally usable hosts, while a /16 contains 65,536 total addresses and 65,534 usable hosts. Every returned address uses canonical dotted-decimal notation. That stable shape is useful when comparing results in tests, inserting calculated boundaries into an inventory record, or showing a reviewer exactly what an access rule covers.
Handle /31, /32, and broad ranges correctly
The two narrowest IPv4 prefixes need explicit treatment. A /31 contains two addresses and is commonly used for point-to-point links under RFC 3021, where both endpoints are usable. The calculator therefore reports the lower address as the first usable IP, the upper address as the last usable IP, and a usable host count of two. A /32 represents exactly one host route, so its network, broadcast, first usable, and last usable values are all the same address, with one usable host. At the other extreme, /0 covers the complete IPv4 address space from 0.0.0.0 through 255.255.255.255. The calculation uses exact integer operations over the full unsigned 32-bit range, avoiding signed bitwise surprises near addresses beginning with 128 through 255. These conventions make the output practical for routing tables and link assignments as well as traditional LAN subnet planning. If your organization applies a different policy to /31 or /32 blocks, use the returned boundaries while enforcing that local allocation policy separately.
What you can do with it
Review firewall scope
Expand an IPv4 CIDR value into concrete lower and upper boundaries before approving an allowlist or deny rule.
Validate provisioning input
Reject malformed addresses and impossible prefixes before a subnet value reaches infrastructure automation.
Plan host allocation
Find the first and last usable addresses and the available host count for an assigned IPv4 block.
FAQ
What does the calculator cost?
It is free to run in your browser. An API request costs $0.002.
Must I enter the network address?
No. You can enter any IPv4 address inside the block, and the calculator derives the network boundary from the prefix.
What prefixes are accepted?
Every integer prefix from 0 through 32 is accepted. Negative values, values above 32, and fractional or nonnumeric prefixes are rejected.
How are /31 networks handled?
Both addresses are reported as usable endpoints, following the common RFC 3021 point-to-point interpretation.
How is a /32 handled?
A /32 contains one address. The network, broadcast, first usable, and last usable fields therefore contain that same address.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/data/ipv4-cidr-range \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"cidr":"192.168.1.10/24"}'const res = await fetch("https://api.kit.forhosting.com/data/ipv4-cidr-range", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"cidr": "192.168.1.10/24"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/data/ipv4-cidr-range",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"cidr": "192.168.1.10/24"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/data/ipv4-cidr-range", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"cidr":"192.168.1.10/24"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"cidr":"192.168.1.10/24"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/data/ipv4-cidr-range", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"cidr": "192.168.1.10/24"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "data.ipv4_cidr_range",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_mb | 25 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |