← All tool references

Converters · execute

Length Converter

Convert lengths across metric, imperial, and nautical units with exact factors and a live equivalence table.

Open public tool

Overview

Category
Converters
API mode
execute
Processing
client-side
Privacy
no-data-stored

Public descriptor

The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.

GET /api/v1/tools/length-converter

View this descriptor as JSON

Execute availability

This tool has an execute route defined by its descriptor. Server-side execution is currently unavailable, so requests return api_not_launched.

POST /api/v1/tools/length-converter/execute

Authentication is not issued during the preview. A bearer API key is planned for execution after launch.

Input schema

object object; additional properties are not accepted.

value · number · required
Enter the value you want translated, converted, or used in the selected calculation mode.
from_unit · string · required
Choose the unit the original length is currently measured in. Accepted values: micrometer, millimeter, centimeter, m, km, inch, ft, yard, mile, nautical_mile.
to_unit · string · required
Choose the length unit you want to receive. Accepted values: micrometer, millimeter, centimeter, m, km, inch, ft, yard, mile, nautical_mile.
{
    "type": "object",
    "properties": {
        "value": {
            "type": "number",
            "description": "Enter the value you want translated, converted, or used in the selected calculation mode."
        },
        "from_unit": {
            "type": "string",
            "enum": [
                "micrometer",
                "millimeter",
                "centimeter",
                "m",
                "km",
                "inch",
                "ft",
                "yard",
                "mile",
                "nautical_mile"
            ],
            "description": "Choose the unit the original length is currently measured in."
        },
        "to_unit": {
            "type": "string",
            "enum": [
                "micrometer",
                "millimeter",
                "centimeter",
                "m",
                "km",
                "inch",
                "ft",
                "yard",
                "mile",
                "nautical_mile"
            ],
            "description": "Choose the length unit you want to receive."
        }
    },
    "required": [
        "value",
        "from_unit",
        "to_unit"
    ],
    "additionalProperties": false
}

Output schema

On a successful execution, schema values appear in data.result.values.

result · number
Value in the target unit.
formula · string
Conversion factor summary.
{
    "type": "object",
    "properties": {
        "result": {
            "type": "number",
            "description": "Value in the target unit."
        },
        "formula": {
            "type": "string",
            "description": "Conversion factor summary."
        }
    },
    "additionalProperties": false
}

Convert one inch to millimeters

The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.

curl -X POST "https://utilitypages.org/api/v1/tools/length-converter/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "value": 1,
    "from_unit": "inch",
    "to_unit": "millimeter"
}'
{
    "ok": true,
    "data": {
        "slug": "length-converter",
        "result": {
            "values": {
                "result": 25.39999999999999857891452847979962825775146484375,
                "formula": "Exact SI factor"
            },
            "display": {
                "display": "25.4"
            },
            "warnings": [],
            "assumptions": [],
            "steps": []
        }
    },
    "meta": [],
    "request_id": "req_example_123"
}

Errors

api_not_launched · 503
Returned by the current launch gate for every execute request.
invalid_json · 400
Returned when an enabled execute request does not contain valid JSON.
validation_failed · 422
Returned when a request does not satisfy the input schema.
browser_interaction_required · 422
Returned for browser capability tools instead of inventing a server-side result.
tool_not_found · 404
Returned when a requested descriptor slug does not exist.
execution_failed · 503
Returned when an enabled server-side execution cannot complete.