Conversion Utilities

Miles To Kilometers

Converts miles to kilometers using the precise conversion factor of 1.609344. Access via MCP in Cursor or Claude Code, or use the REST endpoint `/v1/convert/length/mi-to-km`. For example, 10 miles converts to exactly 16.09344 km. Returns deterministic results with full precision for distance calculations in mapping, fitness, and navigation applications.

API Endpoint

GET /v1/convert/length/mi-to-km

Code Examples

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

response = requests.get('https://tinyfn.io/v1/convert/length/mi-to-km',
    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 conversion tools:

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

Learn more about MCP setup →

FAQ

How accurate is the miles to kilometers conversion?

Uses the exact international conversion factor of 1.609344, providing precise results to full decimal precision without rounding errors.

Can MCP tools like Cursor access this conversion for code calculations?

Yes, available as an MCP tool in Cursor, Claude Code, Windsurf, and other supported editors for real-time distance conversions in your code.

What's the difference between statute miles and nautical miles conversion?

This converts statute miles (land miles) to kilometers. Nautical miles use a different conversion factor (1.852 km per nautical mile).

Does the API handle fractional miles input?

Yes, accepts decimal values like 2.5 miles and returns the precise kilometer equivalent (4.02336 km).

What format does the REST API return?

Returns JSON with the converted value, typically including both the numeric result and unit labels for clarity.

Try Miles To Kilometers Now

Get your free API key and start using Miles To Kilometers in seconds.

Get Free API Key