Convert XML to CSV
Convert XML to CSV instantly. Paste XML below and copy the CSV result.
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();Convert XML to CSV
This converter turns XML into CSV entirely in your browser. It reads your XML, maps it to rows and columns, and writes clean CSV. For example, this XML:
XML input
<rows><row><name>Ada</name><role>Engineer</role></row><row><name>Linus</name><role>Maintainer</role></row></rows>becomes this CSV:
CSV output
name,role
Ada,Engineer
Linus,MaintainerYour data never leaves your device. No cost, no signup, no tracking.
Frequently asked questions
Does it handle nested or quoted fields?
It handles quoted values, embedded commas, and newlines. Deeply nested JSON is flattened to columns where possible; keep objects flat (an array of records) for the cleanest CSV.
Can I use this from the command line or an AI agent?
Yes. It is a REST endpoint at https://api.clean.tools/v1/convert_data and an MCP server you can add to Claude, Claude Code, or Cursor. The @clean-tools/mcp npm package runs it as a local stdio server.
More converters
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 →