{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"subnet-calculator"},"result":{"entity_type":"calculator","id":"subnet-calculator","calculator_id":"subnet-calculator","canonical_url":"https://tttkmbb.com/developer/subnet-calculator","name":"IP Subnet Calculator","title":"IPv4 Subnet Calculator – Network, Broadcast, Mask, Host Range and Usable Hosts from CIDR","category":"developer","category_name":"Developer & IT","tool_name":"calculate_subnet","featured_mcp_tool":true,"description":"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.","use_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.","do_not_use_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).","inputs":[{"name":"cidr","label":"IPv4 address with prefix or mask","type":"string","required":true,"description":"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.","example":"192.168.1.10/26"}],"outputs":[{"name":"ip_address","label":"IP address","type":"string","decimals":4,"description":"The address as parsed (dotted quad)."},{"name":"cidr_notation","label":"Subnet (CIDR)","type":"string","decimals":4,"description":"Network address with prefix length, e.g. 192.168.1.0/26."},{"name":"network_address","label":"Network address","type":"string","decimals":4,"description":"ip AND mask: the first address of the block."},{"name":"broadcast_address","label":"Broadcast address","type":"string","decimals":4,"description":"network OR wildcard: the last address of the block (equals the address itself for /32)."},{"name":"subnet_mask","label":"Subnet mask","type":"string","decimals":4,"description":"Dotted-decimal mask with prefix_length leading one bits."},{"name":"wildcard_mask","label":"Wildcard mask","type":"string","decimals":4,"description":"Bitwise complement of the subnet mask (used in Cisco ACLs)."},{"name":"prefix_length","label":"Prefix length","type":"integer","unit":"bits","decimals":4,"description":"Number of network bits (the /n)."},{"name":"host_bits","label":"Host bits","type":"integer","unit":"bits","decimals":4,"description":"32 − prefix_length."},{"name":"first_host","label":"First usable host","type":"string","decimals":4,"description":"network + 1 (for /31 and /32 the network address itself, RFC 3021)."},{"name":"last_host","label":"Last usable host","type":"string","decimals":4,"description":"broadcast − 1 (for /31 the second address, for /32 the address itself)."},{"name":"usable_hosts","label":"Usable hosts","type":"integer","decimals":0,"description":"2^host_bits − 2, except 2 for /31 (RFC 3021 point-to-point) and 1 for /32."},{"name":"total_addresses","label":"Total addresses","type":"integer","decimals":0,"description":"2^host_bits including network and broadcast."},{"name":"ip_class","label":"Address class","type":"string","decimals":4,"description":"Historical classful class from the first octet: A (0–127), B (128–191), C (192–223), D (224–239, multicast), E (240–255, reserved)."},{"name":"is_private","label":"Private (RFC 1918)","type":"boolean","decimals":4,"description":"true when the address lies in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16; loopback and link-local blocks are reported separately in address_scope."},{"name":"address_scope","label":"Address scope","type":"string","decimals":4,"description":"Special-use block the address belongs to (RFC 1918 private, loopback, link-local, CGNAT, multicast, reserved) or public."},{"name":"binary_mask","label":"Mask (binary)","type":"string","decimals":4,"description":"Subnet mask as four 8-bit groups."},{"name":"binary_address","label":"Address (binary)","type":"string","decimals":4,"description":"The IP address as four 8-bit groups."},{"name":"ip_integer","label":"Address as integer","type":"integer","decimals":0,"description":"The address as an unsigned 32-bit integer (a·2^24 + b·2^16 + c·2^8 + d)."}],"input_schema":{"type":"object","properties":{"cidr":{"description":"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.","type":"string","examples":["192.168.1.10/26"]}},"additionalProperties":false,"required":["cidr"]},"output_schema":{"type":"object","properties":{"ip_address":{"description":"The address as parsed (dotted quad).","type":"string"},"cidr_notation":{"description":"Network address with prefix length, e.g. 192.168.1.0/26.","type":"string"},"network_address":{"description":"ip AND mask: the first address of the block.","type":"string"},"broadcast_address":{"description":"network OR wildcard: the last address of the block (equals the address itself for /32).","type":"string"},"subnet_mask":{"description":"Dotted-decimal mask with prefix_length leading one bits.","type":"string"},"wildcard_mask":{"description":"Bitwise complement of the subnet mask (used in Cisco ACLs).","type":"string"},"prefix_length":{"description":"Number of network bits (the /n). Unit: bits.","type":"integer","x-unit":"bits"},"host_bits":{"description":"32 − prefix_length. Unit: bits.","type":"integer","x-unit":"bits"},"first_host":{"description":"network + 1 (for /31 and /32 the network address itself, RFC 3021).","type":"string"},"last_host":{"description":"broadcast − 1 (for /31 the second address, for /32 the address itself).","type":"string"},"usable_hosts":{"description":"2^host_bits − 2, except 2 for /31 (RFC 3021 point-to-point) and 1 for /32.","type":"integer"},"total_addresses":{"description":"2^host_bits including network and broadcast.","type":"integer"},"ip_class":{"description":"Historical classful class from the first octet: A (0–127), B (128–191), C (192–223), D (224–239, multicast), E (240–255, reserved).","type":"string"},"is_private":{"description":"true when the address lies in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16; loopback and link-local blocks are reported separately in address_scope.","type":"boolean"},"address_scope":{"description":"Special-use block the address belongs to (RFC 1918 private, loopback, link-local, CGNAT, multicast, reserved) or public.","type":"string"},"binary_mask":{"description":"Subnet mask as four 8-bit groups.","type":"string"},"binary_address":{"description":"The IP address as four 8-bit groups.","type":"string"},"ip_integer":{"description":"The address as an unsigned 32-bit integer (a·2^24 + b·2^16 + c·2^8 + d).","type":"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)","method":"Classless (CIDR, RFC 4632) arithmetic on 32-bit unsigned integers; /31 follows RFC 3021 (both addresses usable on point-to-point links). Class letters are the historical classful designations only.","sources":[{"name":"RFC 4632 – Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan","url":"https://www.rfc-editor.org/rfc/rfc4632","type":"standard","retrieved_at":"2026-09-24"},{"name":"RFC 1918 – Address Allocation for Private Internets","url":"https://www.rfc-editor.org/rfc/rfc1918","type":"standard","retrieved_at":"2026-09-24"},{"name":"RFC 3021 – Using 31-Bit Prefixes on IPv4 Point-to-Point Links","url":"https://www.rfc-editor.org/rfc/rfc3021","type":"standard","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"192.168.1.10/26","inputs":{"cidr":"192.168.1.10/26"},"expected":{"network_address":"192.168.1.0","broadcast_address":"192.168.1.63","subnet_mask":"255.255.255.192","wildcard_mask":"0.0.0.63","first_host":"192.168.1.1","last_host":"192.168.1.62","usable_hosts":62,"total_addresses":64,"prefix_length":26,"ip_class":"C","is_private":true,"ip_integer":3232235786,"binary_mask":"11111111.11111111.11111111.11000000"},"url":"https://tttkmbb.com/api/v1/calculate/subnet-calculator?cidr=192.168.1.10%2F26"},{"name":"10.0.0.0/8 (whole class A private block)","inputs":{"cidr":"10.0.0.0 255.0.0.0"},"expected":{"network_address":"10.0.0.0","broadcast_address":"10.255.255.255","usable_hosts":16777214,"total_addresses":16777216,"prefix_length":8,"first_host":"10.0.0.1","last_host":"10.255.255.254","ip_class":"A"},"url":"https://tttkmbb.com/api/v1/calculate/subnet-calculator?cidr=10.0.0.0+255.0.0.0"}],"faq":[{"q":"Why does a /31 report 2 usable hosts?","a":"RFC 3021 allows both addresses of a /31 on point-to-point links, since no broadcast address is needed; a /32 is a single host route. Every other prefix loses the network and broadcast addresses."},{"q":"Can I enter the mask instead of the prefix?","a":"Yes: 192.168.1.10 255.255.255.192 and 192.168.1.10/255.255.255.192 are both accepted. The mask must be contiguous ones followed by zeros."},{"q":"Does is_private cover loopback and link-local addresses?","a":"No, is_private is strictly RFC 1918; 127.0.0.0/8 (loopback), 169.254.0.0/16 (link-local) and 100.64.0.0/10 (carrier-grade NAT) are named in address_scope instead."}],"tags":["subnet calculator","cidr","subnet mask","ip calculator","usable hosts","network address"],"related":[{"calculator_id":"base-converter","reason":"Convert an octet or the whole address between binary, decimal and hexadecimal."},{"calculator_id":"bitwise-operations","reason":"AND/OR/NOT on 32-bit values is exactly what subnet masking does."},{"calculator_id":"bandwidth-delay-product","reason":"Another network-engineering calculation: TCP window size for a link."}],"links":{"html":"https://tttkmbb.com/developer/subnet-calculator","markdown":"https://tttkmbb.com/developer/subnet-calculator.md","json":"https://tttkmbb.com/developer/subnet-calculator.json","api":"https://tttkmbb.com/api/v1/calculate/subnet-calculator","schema":"https://tttkmbb.com/api/v1/calculators/subnet-calculator","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T03:46:19Z","next_actions":[{"tool":"calculate_subnet","calculator_id":"subnet-calculator","reason":"Run IP Subnet Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/developer/subnet-calculator.md"}}