x402AgentTools

πŸ“Length Converter

Convert between metric and imperial length units: kilometers, meters, centimeters, millimeters, micrometers, nanometers, miles, yards, feet, inches and nautical miles.

Worked examples

1 Kilometers in Meters

GET /api/v1/converters/length-converter?value=1&from=km&to=m

Result: 1,000 m

100 Kilometers in Meters

GET /api/v1/converters/length-converter?value=100&from=km&to=m

Result: 100,000 m

5 Meters in Kilometers

GET /api/v1/converters/length-converter?value=5&from=m&to=km

Result: 0.005 km

2 Kilometers in Centimeters

GET /api/v1/converters/length-converter?value=2&from=km&to=cm

Result: 200,000 cm

Machine API (x402)

$0.001 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol β€” no accounts, no API keys.

GET /api/v1/converters/length-converter?value=1&from=km&to=m HTTP/1.1
Host: agenttools-hub.vercel.app

β†’ 402 (payment required, instructions in headers)
β†’ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "converters/length-converter",
  "input": {"value":1,"from":"km","to":"m"},
  "result": { "value": 1000, "answer": "1,000 m" }
}

Agent docs: /llms.txt Β· OpenAPI spec Β· integration guide

About this tool

Convert any length or distance unit to any other with exact international definitions β€” miles, kilometers, feet, inches, nautical miles and the metric scale from nanometers to kilometers.

value Γ— kmfactor Γ· target factor (all units relate to the m base)

Frequently asked questions

How many kilometers in a mile?

One mile is exactly 1.609344 kilometers by international agreement since 1959.

How many feet in a meter?

One meter is 3.28084 feet (or about 3 ft 3.37 in).

What is a nautical mile?

One nautical mile is exactly 1,852 meters β€” one arc-minute of latitude, used in aviation and marine navigation.

Popular conversions & variations

Related tools