IP Subnet Calculator
calculate_subnetUse this when you need to know which subnet an IPv4 address belongs to, the host range and count of a /prefix, or the mask equivalent of a prefix length. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.
Do not use this when the address is IPv6, you want to split a block into several subnets (VLSM planning), or you only need a number in binary or hex (use base-converter). What it computes: Computes the network and broadcast addresses, subnet and wildcard masks, first and last host, usable and total addresses, address class and RFC 1918 private status for an IPv4 address in CIDR notation or with a dotted subnet mask, using 32-bit unsigned arithmetic. Inputs: cidr (string). Complete JSON argument examples: {"cidr":"192.168.1.10/26"} | {"cidr":"10.0.0.0 255.0.0.0"} Outputs: ip_address, cidr_notation, network_address, broadcast_address, subnet_mask, wildcard_mask, prefix_length [bits], host_bits [bits], first_host, last_host, usable_hosts, total_addresses, ip_class, is_private, address_scope, binary_mask, binary_address, ip_integer. Formula: mask = 2^32 − 2^(32 − prefix); network = ip AND mask; broadcast = network OR NOT mask; total = 2^(32 − prefix); usable = total − 2 (prefix ≤ 30), 2 (prefix 31), 1 (prefix 32) Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/subnet-calculator with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/developer/subnet-calculator.md
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cidr | Yes | IPv4 address followed by /prefix (0–32) or by a dotted subnet mask separated by a space or slash, e.g. 192.168.1.10/26 or 192.168.1.10 255.255.255.192. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| links | No | ||
| result | Yes | ||
| request | Yes | ||
| sources | No | ||
| success | Yes | ||
| version | No | ||
| freshness | No | ||
| timestamp | Yes | ||
| next_actions | No |