Unit Converter
Convert between units of measurement in your browser. Nothing leaves your device.
Convert
Use this tool from AI agents
This tool's engine is available to AI agents over MCP as convert_units. Add the Clean.tools server, then your agent can call it directly.
claude mcp add --transport http clean-tools https://mcp.clean.tools/mcpclaude mcp add --transport http clean-tools https://mcp.clean.tools/mcp{"mcpServers":{"clean-tools":{"command":"npx","args":["-y","@clean-tools/mcp"]}}}{"mcpServers":{"clean-tools":{"command":"npx","args":["-y","@clean-tools/mcp"]}}}https://mcp.clean.tools/mcphttps://mcp.clean.tools/mcpOr call it over plain HTTP from any script. Same engine, JSON in and JSON out, no key:
curl -s https://api.clean.tools/v1/convert_units \
-H 'content-type: application/json' \
-d '{"category":"length","value":10,"from":"km","to":"mile"}'curl -s https://api.clean.tools/v1/convert_units \
-H 'content-type: application/json' \
-d '{"category":"length","value":10,"from":"km","to":"mile"}'const res = await fetch('https://api.clean.tools/v1/convert_units', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ category: 'length', value: 10, from: 'km', to: 'mile' })
});
const data = await res.json();const res = await fetch('https://api.clean.tools/v1/convert_units', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ category: 'length', value: 10, from: 'km', to: 'mile' })
});
const data = await res.json();How it works
This unit converter runs entirely in your browser using plain JavaScript arithmetic. Select a category, choose your source and target units, and type a value. The conversion happens instantly as you type. For most categories, values are converted through a base unit (meters for length, kilograms for weight, liters for volume, etc.). Temperature uses dedicated formulas for Celsius, Fahrenheit, and Kelvin conversions.
No data is sent to a server. All calculations happen locally on your device. It works on any modern browser, on both mobile and desktop. No cost, no signup, no tracking.
You can also run the same conversions from scripts or AI agents: the unit-converter API exposes the convert_units engine over REST, and the same engine ships as an MCP server in the @clean-tools/mcp package on npm.
Frequently asked questions
Which gallons, quarts, and cups does the volume converter use?
Volume uses US customary measures: one US gallon is 3.785 liters and one US fluid ounce is about 29.57 milliliters. US and Imperial units differ, so an Imperial gallon (4.546 liters) will read low here.
Are data sizes based on 1024 or 1000?
Data uses binary multiples, so 1 KB is 1024 bytes, 1 MB is 1024 KB, and so on up to terabytes. Drive makers often advertise decimal sizes (1 MB as 1,000,000 bytes), which is why an advertised capacity looks smaller once your operating system reports it.
Why do very large or very small results show as exponential notation?
Results are rounded to 12 significant digits, and values at or above 1e15 or below 1e-10 switch to exponential form to stay readable and accurate. Ordinary conversions display as plain decimals.
How does temperature conversion differ from the other categories?
Temperature is not a simple multiply, because Celsius, Fahrenheit, and Kelvin have different zero points. The tool routes each value through Celsius using the correct offset formulas instead of a single scaling factor.
Can I use this from the command line or an AI agent?
Yes. Send a POST request to https://api.clean.tools/v1/convert_units with a JSON body and you get the converted value back as JSON, so you can wire it into any script. The same engine is also an MCP server you can add to Claude, Claude Code, or Cursor, and the @clean-tools/mcp npm package runs it as a local stdio server on your own machine.
Common conversions
Jump to a ready-made conversion, or browse all unit conversions.
More tools from Clean.tools
Use Clean.tools from your AI agent
This tool is also convert_units on the Clean.tools MCP server — the same engine, callable by your AI agent directly. No key, no signup: requests are processed in memory and request contents are never stored.
claude mcp add --scope user --transport http clean-tools https://mcp.clean.tools/mcpclaude mcp add --scope user --transport http clean-tools https://mcp.clean.tools/mcphttps://mcp.clean.tools/mcphttps://mcp.clean.tools/mcpEvery tool, the REST API, and setup for Cursor, Claude Desktop, VS Code & more →