Convert

XML to CSV Converter

Convert a row-shaped XML file into a clean CSV in your browser. No upload, no signup, no data leaves your device.

XML is what older enterprise systems, government data feeds, and SOAP APIs hand you when you ask for tabular data. It's verbose, awkward to skim, and incompatible with almost every modern BI and spreadsheet tool. CSV is the format your downstream tools actually want. This converter handles the common case — a flat, row-shaped XML document — without making you write XSLT.

Conversion runs entirely in your browser using the native DOMParser. Your file never touches a server. The expected input shape is documented in the FAQ; deeply nested XML, attributes, and namespaced documents need to be flattened before they're a fit for this tool.

How it works

Three steps, no signup

  1. 1

    Drop your XML

    Drag a .xml file into the box above, or click to pick one. The file should follow the row-shaped pattern shown in the FAQ.

  2. 2

    We extract rows and columns

    Each direct child of the root becomes a row. Each child of a row becomes a column. Headers are taken from the union of column names across rows, in first-seen order.

  3. 3

    Download the .csv

    A standards-compliant CSV is ready instantly. Open it in Excel, Google Sheets, or any tool that expects CSV.

FAQ

Frequently asked questions

What XML structure does this expect?
A flat, row-shaped document like this: <rows> <row> <col_a>value</col_a> <col_b>value</col_b> </row> <row> <col_a>value</col_a> <col_b>value</col_b> </row> </rows> The root element name is ignored — you can call it `<rows>`, `<data>`, `<results>`, whatever. Each direct child of the root is one row. Each child of a row is one column.
What happens to XML attributes?
Ignored in v1. So `<row id="42"><name>Alice</name></row>` produces a row with only a `name` column — the `id` attribute is dropped. If your data has important attributes, transform the XML first to promote them into child elements (e.g., add `<id>42</id>` alongside `<name>`).
Are nested elements supported?
No, not in v1. The converter expects each row's children to be leaf elements containing text. If you have something like `<row><address><city>NYC</city></address></row>`, the `<address>` cell will end up containing the concatenated text of its descendants — which is rarely what you want. Flatten nested XML to a single level before converting (XSLT, a quick script, or a tool like xq).
What about XML namespaces?
The DOMParser preserves namespaces in element names, so `<ns:row>` produces a column header literally called `ns:row`. If your XML is namespaced and you'd prefer clean column names, strip the namespace prefixes from your source before converting (`sed 's/ns://g'` on the file is usually enough for simple documents).
What if my rows have different column sets?
The CSV output is rectangular: every row has every column. Headers are the union of all column names seen across every row, in first-seen order. Rows missing a column produce an empty cell. If three of your rows had `<phone>` and the rest didn't, the CSV will still have a `phone` column — just empty for the rows that lacked it.
Why does it fail with "Unrecognized XML structure"?
Most often: your XML doesn't have child elements at all (it's just one element with text), it's a single object rather than a list of rows, or the parser hit malformed XML. Open the file and confirm it matches the structure shown above. If your data is genuinely a single record, wrap it in a parent element first to make it a one-row "list."
Are commas, quotes, and newlines in XML cell values handled correctly?
Yes — the CSV writer applies RFC 4180 quoting. Cells with commas, double quotes, or newlines get wrapped in double quotes, with embedded quotes doubled. So an XML cell containing `She said "hi"` becomes `"She said ""hi"""` in the CSV. Excel and every other compliant CSV reader handle this.

Need to compare two files?

Drop two spreadsheets and see every change in seconds. Free, private, runs in your browser.