Converts kilometers to miles with precise calculation using the standard conversion factor (1 km = 0.621371 miles). Access via MCP in Cursor or Windsurf for AI-assisted distance calculations, or call GET /v1/convert/length/km-to-mi directly. Returns exact decimal results — no rounding or approximation errors that plague manual calculations.
curl "https://tinyfn.io/v1/convert/length/km-to-mi" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/convert/length/km-to-mi', {
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/km-to-mi',
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 conversion factor of 0.621371192 miles per kilometer, providing precision to multiple decimal places without rounding errors.
Yes, accepts any numeric input including decimals. For example, 2.5 km converts to exactly 1.553428 miles.
Enable TinyFn's MCP server in your editor, then ask your AI assistant to convert distances. It will call the tool automatically for accurate results.
Returns a JSON response with the converted miles value as a number, maintaining full precision of the calculation.
Eliminates floating-point precision errors and ensures consistent results across different programming languages and platforms.
Get your free API key and start using Kilometers To Miles in seconds.
Get Free API Key