XML

XML to CSV Converter

Finds the repeated element in an XML document, treats it as a row, and flattens its children and attributes into columns.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste XML that contains a repeated element — the thing you want one row per.
  2. Choose the delimiter your spreadsheet or loader expects.
  3. Select Convert to CSV and check that the row count matches the number of records you expected.
  4. Download the CSV, or copy it straight into a spreadsheet.

What xml to csv does

A table hidden in an XML document is almost always the element that repeats: a catalog of <book> elements is a table of books, and an <orders> wrapper holding <order> elements is a table of orders. This converter looks for that repeated element, uses it as the row, and turns each descendant into a column with a dotted name so nesting survives.

An empty cell here means the element was absent from that record, which is not the same as a value that is present and empty — CSV cannot tell those apart, and neither can anything reading the file afterwards. If that distinction matters to you, convert to JSON instead, where a missing key and a null are different things.

Frequently asked questions

It looks for the element that repeats most often, first among the children of the root and then one level in. In a catalog of books that is the book element. If your document nests the records deeper than that, convert to JSON first and flatten from there.

Because that element was absent from that record. CSV has no way to distinguish an absent field from a present but empty one, so both arrive as an empty cell and anything reading the file afterwards inherits that ambiguity. Convert to JSON instead if the difference matters.

They become columns like anything else, named with an @ in front so you can tell an attribute apart from a child element that happens to share its name. A spreadsheet will show that @ in the header; rename the column after import if it bothers you.