# IP subnet calculator

> Enter an IPv4 address in CIDR notation and get the network, netmask, broadcast address, first and last host and how many hosts fit. Free.

Free tool by Orkosi. Page: https://orkosi.com/tools/ip-subnet-calculator

Planning a VPC, a firewall rule or an office network? Type an address with its prefix and read the whole block: where it starts, where it ends and how many machines it holds.

1. Type an IPv4 address with a prefix, such as 10.0.4.20/22.
2. Press Calculate.
3. Read the range, the mask and the host count.

## Input

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `cidr` | text | yes | Address and prefix. |

## Example

Input:

```json
{
  "cidr": "10.0.4.20/22"
}
```

Result:

```json
{
  "network": "10.0.4.0/22",
  "netmask": "255.255.252.0",
  "wildcard": "0.0.3.255",
  "broadcast": "10.0.7.255",
  "first_host": "10.0.4.1",
  "last_host": "10.0.7.254",
  "usable_hosts": 1022,
  "total_addresses": 1024,
  "scope": "Private (RFC 1918)"
}
```

## Run it

It needs a free Orkosi account, nothing else. No credits are used.

- **A person**: open the page, enter an e-mail once, use the tool.
- **Claude or ChatGPT**: add the Orkosi connector `https://orkosi.com/api/v1/public/mcp` and sign in, or create the free account on the sign-in page. Then call `orkosi_run_free_tool` with `{ "tool": "ip-subnet-calculator", "input": { … } }`.
- **Any agent or program that can make an HTTP request**:

  1. Once, create the account: `POST https://orkosi.com/api/v1/public/signup` with `{ "name": "…", "email": "…", "terms_accepted": true }` and no key. Ask the person for the e-mail and their agreement to the terms first. The answer carries `data.api_key`, shown once.
  2. Run the tool:

```bash
curl -X POST https://orkosi.com/api/v1/public/tools/ip-subnet-calculator/run \
  -H "Authorization: Bearer $ORKOSI_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":{"cidr":"10.0.4.20/22"}}'
```

The answer is `{ "data": { "tool": "…", "result": { … } } }`. A call without a key is answered 401 with the signup steps as data.

## Questions

**What does /24 mean?**

The first 24 bits name the network and the remaining 8 name the hosts: 256 addresses, 254 of them usable.

**Why are two addresses not usable?**

The first is the network address and the last is the broadcast address. A /31 and a /32 are the exceptions: every address counts.

**Which ranges are private?**

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They never route on the public internet.

All free tools: https://orkosi.com/tools.md
