IP Address Utilities

Subnet Calculator

Calculate network subnets with precise CIDR notation, IP ranges, and host counts. Access via MCP in Cursor or Windsurf for network planning, or REST API at /v1/ip/subnet. Input a network like 192.168.1.0/24 with desired subnet size to get calculated ranges, broadcast addresses, and usable host counts. Returns deterministic subnet divisions for network architecture.

API Endpoint

GET /v1/ip/subnet

Code Examples

curl "https://tinyfn.io/v1/ip/subnet" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/ip/subnet', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/ip/subnet',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's ip address tools:

{
  "mcpServers": {
    "tinyfn-ip": {
      "url": "https://tinyfn.io/mcp/ip",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I calculate subnets for a 192.168.1.0/24 network?

Pass the network CIDR and desired subnet count or size. Returns subnet ranges, broadcast addresses, and host counts for each calculated subnet.

What subnet information does the calculator provide?

Network address, broadcast address, usable IP range, subnet mask, and host count for each subnet. Also validates CIDR notation and calculates optimal divisions.

Can MCP agents use this for network planning in infrastructure code?

Yes, AI agents in Cursor or Claude Code can calculate subnets for Terraform, Ansible, or cloud infrastructure configurations automatically.

Does it handle IPv6 subnets or just IPv4?

Supports both IPv4 and IPv6 subnet calculations with proper CIDR notation. IPv6 returns prefix lengths and address ranges.

What happens if I request more subnets than the network can support?

Returns an error indicating insufficient address space. Shows maximum possible subnets for the given network size.

Try Subnet Calculator Now

Get your free API key and start using Subnet Calculator in seconds.

Get Free API Key