Output
Use this tool from AI agents
This tool's engine is available to AI agents over MCP as convert_data. 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_data \
-H 'content-type: application/json' \
-d '{"data":"id,name\n1,Ada\n2,Grace","from":"csv","to":"json"}'curl -s https://api.clean.tools/v1/convert_data \
-H 'content-type: application/json' \
-d '{"data":"id,name\n1,Ada\n2,Grace","from":"csv","to":"json"}'const res = await fetch('https://api.clean.tools/v1/convert_data', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ data: 'id,name\n1,Ada\n2,Grace', from: 'csv', to: 'json' })
});
const data = await res.json();const res = await fetch('https://api.clean.tools/v1/convert_data', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ data: 'id,name\n1,Ada\n2,Grace', from: 'csv', to: 'json' })
});
const data = await res.json();How it works
This data format converter parses input data in one format and re-serializes it in another. All parsing and conversion runs locally in your browser using built-in JSON methods and custom CSV/TSV/XML parsers. No data is sent to a server. If you would rather drive it from scripts or an AI agent, the same engine is available as the convert_data tool through the file-converter API and MCP server, or you can install the @clean-tools/mcp package from npm.
JSON input should be an array of objects. CSV and TSV use the first row as column headers. XML wraps each record in a row element with child elements for each field. The converter handles quoted fields containing delimiters and preserves data types where possible.
Want proof? Open your browser's developer tools and watch the network tab while you work: your data never uploads.
Frequently asked questions
What structure does my JSON need?
JSON input must be an array of objects, for example [{"id": 1}, {"id": 2}]. A single object or a bare value will not convert, since each object becomes one row. Nested objects are flattened into dotted column names like address.city, and arrays are kept as JSON text inside the cell.
How are missing or extra columns handled?
When rows have different keys, the output uses the union of every key seen across all rows. Rows missing a given field get an empty cell for it, so no data is dropped and every column stays aligned.
Does CSV output handle commas and quotes inside values?
Yes. Any value containing the delimiter, a double quote, or a line break is wrapped in quotes, and embedded quotes are doubled per RFC 4180. TSV output uses tabs as the delimiter and applies the same escaping rules.
Is there a file size limit?
There is no fixed limit, but everything runs in your browser tab, so very large files are bound by your device memory. Since no data is uploaded, conversion speed depends only on your own machine.
Can I use this from the command line or an AI agent?
Yes. The converter runs as a REST endpoint at https://api.clean.tools/v1/convert_data, so a curl command or any script can post JSON in and get JSON out. It is also an MCP server you can add to Claude, Claude Code, or Cursor, which lets an agent call the conversion directly. To run it locally, install the @clean-tools/mcp package from npm and it launches as a stdio server on your own machine.
More tools from Clean.tools
Use Clean.tools from your AI agent
This tool is also convert_data 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 →