Skip to main content

XML to CSV Converter

Convert XML with repeating elements into CSV. The repeating row element is auto-detected (or set it yourself), attributes become columns with a configurable prefix, repeated child tags join into one cell, and the header row is the union of every column seen. Runs entirely in your browser.

Input

Drop a file or browse
One file · text
Or

Options

Tag name of the repeating record. Leave blank to auto-detect from the most common direct child of the root.

Prefix for attribute columns, to distinguish them from element columns.

Output

Summary
MetricValue
No data yet
CSV output
 
Was this helpful?

Guides

Paste XML with a repeating record inside it — an orders feed, a product catalog, an RSS-like export — and get a CSV you can open in a spreadsheet. This free online XML to CSV converter auto-detects which element repeats (or you can name it yourself), turns attributes and child elements into columns, and handles nested and repeated fields sensibly. Conversion happens as you type, with no upload and no sign-up.

How to use it

  1. Paste your XML into the input box, or drop an .xml file onto the uploader.
  2. Leave Row element blank to auto-detect the repeating record (the most common direct child of the root), or type the exact tag name yourself.
  3. Pick a delimiter (comma, semicolon, tab or pipe) and line ending (LF or CRLF).
  4. Toggle Include header row, Include XML attributes as columns (with a configurable prefix, @ by default) and Trim whitespace in values to match what your target spreadsheet expects.
  5. Copy or download the result as converted.csv. The Summary panel above the CSV shows which row element was used and how many rows/columns were found.

The output updates automatically as you type.

How does the converter decide what a "row" is?

It looks at the root element's direct children and picks whichever tag appears most often — three <order> elements under <orders> means each <order> becomes one CSV row. If the tag you want is nested one level deeper than the root (say, <item> elements inside a single <items> wrapper), name it explicitly in Row element: the converter first looks among the root's direct children, and if none match, falls back to searching every matching element anywhere in the document.

How do columns get built from one row?

The row element's own attributes become columns (@id, @status, …, using your chosen prefix). Each direct child element becomes a column named after its tag: a leaf child (just text, like <total>129.50</total>) contributes its own text; a child that has its own child elements contributes the text content of its entire subtree instead of an empty cell. A child with attributes additionally contributes tag.@attr columns. The header row is the union of every column seen across all rows, in first-seen order, so columns still line up even when one row is missing a field another row has.

What happens if a child tag (or its attribute) repeats within one row?

Its values join into a single cell separated by " | " rather than creating more columns or more rows — a <book> with two <genre> children becomes one genre column reading Fantasy | Fiction.

What if my XML is malformed, or no rows are found?

The converter parses XML well-formedness first and reports a clear error naming the specific problem. If parsing succeeds but no repeating element can be identified (or the named one doesn't exist, or it has no attributes/child elements to turn into columns), the Summary panel explains why instead of silently producing an empty file.

Is my data private?

Completely. Parsing and conversion run entirely in your browser using a self-contained XML parser — your data is never sent to a server, logged, or stored.

Looking for the reverse conversion, or a different XML target?

The CSV to XML Converter turns CSV back into XML. For structured data instead of a flat table, try the XML to JSON Converter or the XML to YAML Converter.

xmlcsvconverterdataspreadsheetdeveloper

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.