IP Address Utilities

Range To Cidr

Converts IP address ranges like 192.168.1.1-192.168.1.255 into CIDR notation (192.168.1.0/24). Access via GET /v1/ip/range-to-cidr or through MCP in Cursor and other AI editors. Essential for network configuration, firewall rules, and subnet planning where CIDR format is required but you only have start/end IPs.

API Endpoint

GET /v1/ip/range-to-cidr

Code Examples

curl "https://tinyfn.io/v1/ip/range-to-cidr" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/ip/range-to-cidr', {
  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/range-to-cidr',
    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 convert an IP range to CIDR notation?

Send a GET request to /v1/ip/range-to-cidr with start and end IP parameters, or use the MCP tool in your AI editor. It returns the equivalent CIDR blocks that cover the range.

What happens if my IP range doesn't align to standard CIDR boundaries?

The tool returns multiple CIDR blocks that collectively cover your range. For example, 192.168.1.5-192.168.1.20 might return several /32 and smaller blocks.

Can I use this with IPv6 addresses?

Yes, the tool supports both IPv4 and IPv6 ranges. IPv6 ranges work the same way but return IPv6 CIDR notation like 2001:db8::/64.

Why would I need CIDR instead of just IP ranges?

Firewalls, routing tables, and cloud security groups typically require CIDR notation rather than start-end ranges. This tool bridges that gap.

How does this help when configuring AI agents for network tasks?

AI agents using MCP can instantly convert IP ranges from logs or configs into CIDR format needed for AWS security groups, iptables rules, or Kubernetes network policies.

Try Range To Cidr Now

Get your free API key and start using Range To Cidr in seconds.

Get Free API Key