Skip to main content

XML to CSV Converter

Convert repeating XML records into a flattened CSV table

Convert record-oriented XML into a spreadsheet-ready CSV. The converter automatically finds the first group of repeating sibling elements and treats each repeated element as one record; if there is no repeating group, it produces a single row from the document.

Nested element names become dot-separated columns. For example, <products><product sku="A1"><name>Pen</name></product><product sku="B2"><name>Book</name></product></products> becomes two rows with product@sku and product.name columns when attributes are included.

XML can represent multiple lists, mixed content, and deeply nested arrays that do not map cleanly to one table. This tool chooses one repeating record set automatically, leaves missing fields blank, and shows the result before download so you can confirm the mapping.

Files stay on this deviceRuns entirely in your browserFree — no signup

Drop your file here or browse from your device

Accepts XML. Maximum input: 10 MiB. Files above this hard limit are rejected before local processing.

How to Convert

  1. Upload an XML file or paste well-formed XML data
  2. Review the automatically detected record rows and flattened column names
  3. Choose whether XML attributes should be included as columns
  4. Check the table preview, then download the CSV file

Features

  • Use the first repeating sibling element group as CSV rows
  • Flatten nested element names into dot-separated columns
  • Optionally include XML attributes as element@attribute columns
  • Build a shared header from every field found across the records
  • Preview the flattened rows and columns before downloading
  • Reject malformed XML with a visible parsing error

Use Cases

  • Turn repeated records from an API response into rows for spreadsheet review
  • Stage product, inventory, or order XML feeds for a CSV-based import
  • Extract IDs stored in XML attributes alongside nested element values
  • Convert an XML export into a tabular file for a database or analytics workflow

Frequently Asked Questions

Which XML elements become CSV rows?

The converter uses the first group of sibling elements that repeat. Each repeated element becomes one row. If the document has no repeating siblings, the complete document is flattened into a single row.

How are nested XML elements handled?

Nested element paths become dot-separated headers. For example, a name inside product and manufacturer becomes product.manufacturer.name.

What happens to XML attributes?

Keep the attribute option enabled to add columns in element@attribute form, such as product@sku. Turn it off to export element text only.

What if records have different fields?

The converter builds one header from all fields it finds. A record that does not contain a particular element or attribute gets an empty cell in that column.

Can it flatten several unrelated repeating lists?

It selects one repeating record set automatically. XML with several independent lists or complex nested arrays may need to be split or reshaped before conversion so each CSV has one clear row type.

Is the XML uploaded anywhere?

No. Parsing, flattening, preview, and CSV generation all happen in your browser.

Need to convert the other way? Try our Csv To Xml