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.
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)
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"
}
}
}
}
Uses the exact international conversion factor of 1.609344, providing precise results to full decimal precision without rounding errors.
Yes, available as an MCP tool in Cursor, Claude Code, Windsurf, and other supported editors for real-time distance conversions in your code.
This converts statute miles (land miles) to kilometers. Nautical miles use a different conversion factor (1.852 km per nautical mile).
Yes, accepts decimal values like 2.5 miles and returns the precise kilometer equivalent (4.02336 km).
Returns JSON with the converted value, typically including both the numeric result and unit labels for clarity.
Get your free API key and start using Miles To Kilometers in seconds.
Get Free API Key