Planning VPC and subnet layout
Cloud providers reserve additional addresses per subnet (AWS reserves five), so the usable count is lower than the arithmetic. Plan the split before creating resources that cannot be renumbered.
Computes network, broadcast, mask and usable host range for a CIDR block.
—Computes network, broadcast, mask and usable host range for a CIDR block.
192.168.1.0/24
Network 192.168.1.0 · Broadcast 192.168.1.255 · Mask 255.255.255.0 · Usable hosts 254
The /24 prefix gives 256 addresses, 254 usable.
Usable hosts = 2^(32-prefix) − 2 (for IPv4).
Your input is sent to YAS infrastructure because the tool requires server-side processing or public network queries. Input is not stored.
curl -X POST "https://yas.sh/api/v1/tools/ip-subnet-calculator" \
-H "Content-Type: application/json" \
-d '{"input":"192.168.1.0/24"}'const res = await fetch("https://yas.sh/api/v1/tools/ip-subnet-calculator", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"input": "192.168.1.0/24"
}),
});
const data = await res.json();import requests
r = requests.post("https://yas.sh/api/v1/tools/ip-subnet-calculator", json={"input":"192.168.1.0/24"})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| input | string | Yes | CIDR, e.g. 192.168.1.0/24 |
{ "result": { "valid": true, "network": "192.168.1.0", "broadcast": "192.168.1.255", "mask": "255.255.255.0", "hosts": 254, "prefix": 24 } }IPv4 CIDR math: network, broadcast, netmask, usable hosts.
400 VALIDATION_ERROR — invalid input or unsupported option.413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).A CIDR prefix such as /26 says how many leading bits of the address identify the network. The tool converts the address and prefix to binary, applies the mask to derive the network address, sets the host bits to derive the broadcast address, and counts the range between them. Usable hosts are 2^(32−prefix) − 2 for IPv4, subtracting the network and broadcast addresses.
Two conventions break that formula. A /31 has no usable hosts under the general rule, but RFC 3021 defines it as a valid two-address point-to-point link, and a /32 is a single host route. IPv6 does not reserve a broadcast address at all — there is no broadcast in IPv6 — so all addresses in a prefix are usable, and /64 is the standard subnet size because SLAAC requires it.
Cloud providers reserve additional addresses per subnet (AWS reserves five), so the usable count is lower than the arithmetic. Plan the split before creating resources that cannot be renumbered.
Confirming that a CIDR covers exactly the hosts you intend prevents a rule that is one bit too broad — the difference between /24 and /23 is 254 unintended hosts.
Dividing a /24 into four /26 blocks needs the boundaries right; off-by-one subnet math causes overlapping ranges that fail only under load.
Log analysis and access rules constantly need this, and doing it by eye on non-octet boundaries is unreliable.
What this tool deliberately does not do, and where it will disagree with other implementations.