XML to CSV Converter

Convert XML to CSV - free, no upload.

XML to CSV converter
CSV result

Expects one root element containing repeated row elements, each with simple child elements as columns - the shape this site's own CSV-to-XML tool produces. XML attributes and deeply nested elements aren't turned into columns.

What this tool does

Paste XML with repeated row elements under one root, and get back a CSV with the union of every row's child element names as columns.

Converts repeated-row XML to CSV, using the union of every row's child element tag names as columns.

Fills a missing column with an empty CSV cell rather than shifting the remaining values out of position.

Reports the real parser error if the XML isn't well-formed.

Scoped explicitly to the common repeated-row XML shape rather than attempting a general, unpredictable flattening of arbitrary XML.

Treats every direct child of the root element as a row, whatever its tag name is, rather than requiring all rows to share one specific tag.

Pulls a cell's value from the first matching child element by tag name if a row has more than one child with the same tag.

How to use it

  1. Paste your XML.
  2. The result appears automatically.
  3. Copy or download the CSV.

Why use this converter

Row-like XML is awkward in spreadsheets. Flattening repeated elements into columns makes it filterable and sortable.

Why we built it

We built the XML to CSV converter for the common repeated-row shape, rather than promising to flatten arbitrary XML unpredictably. Inspect the source with the XML formatter and tidy the output with the CSV formatter.

Who this tool is for

  • Analysts opening XML feeds in a spreadsheet
  • Developers converting exports
  • Admins moving data between systems

When to use it

  • Opening XML exports in a spreadsheet.
  • Preparing data for analysis.
  • Converting feeds.
  • Inspecting records.

Why this is scoped to one specific XML shape

There's no single row-oriented convention across all XML documents.

XML can represent data in far more shapes than a spreadsheet's rows and columns can express - deeply nested structures, mixed content, and attribute-heavy documents all need different flattening rules. Rather than guessing at a general-purpose flattening scheme that would behave unpredictably on unusual documents, this tool targets the specific, common repeated-row shape directly and is upfront that other XML shapes aren't supported.

What happens with repeated tags and nested content inside a row

Two edge cases inside a row element are worth understanding before you rely on the output.

Two children with the same tag name

Column values are found by searching a row's direct children for the first one whose tag matches each column name. If a row happens to have two children with the same tag - two <phone> elements, say - only the first one's text ends up in that column; the second is silently ignored rather than becoming an extra column or an extra row.

Text inside a grandchild element still shows up

Columns come from a row's direct children only, so a grandchild element - something nested one level deeper - never becomes its own column. But its text isn't dropped: this tool reads each column's value with the browser's own textContent, which recurses into every descendant and concatenates all their text together. So if a child element itself contains nested child elements, the text inside those nested elements still appears in the parent's cell, just run together rather than split into separate columns.

Row XML fragmentWhat ends up in the CSV
<row><tag>A</tag><tag>B</tag></row>Column "tag" = "A" (the second <tag> is ignored)
<row><addr><city>NYC</city></addr></row>Column "addr" = "NYC" (city's text, not a separate column)

What you give it, and what you get back

Input and output of XML to CSV Converter
ItemDetails
InputXML with repeated row elements.
OutputCSV with a column for each child element.
NotesMissing values are empty cells.

Issues you may run into

Common problems with XML to CSV Converter
What you seeWhy it happensWhat to do
Attributes are missingOnly child elements become columns.Move values into elements first.
Nested data is missingGrandchildren are not flattened.Flatten the XML first.
An error message appearsThe input is not valid for this format.Fix the problem the message points to.

Assumptions and limitations

Frequently asked questions

How do I convert XML to CSV for free?

Paste XML with repeated row elements under one root element, and the CSV is built automatically.

What XML structure does this expect?

One root element containing repeated row elements, each with simple child elements as columns - the same shape this site's CSV-to-XML tool produces.

Are XML attributes included as columns?

No - only child elements become columns.

What happens if one row is missing a column another row has?

That cell is left empty in the output rather than shifting the remaining values out of position.

What if a row has two child elements with the same tag name?

Only the first one's text is used for that column - the second matching element is ignored rather than creating an extra column or row.

Does text inside a nested (grandchild) element get included?

Yes, indirectly - it isn't given its own column, but its text is still pulled into its parent's cell because the value is read with textContent, which concatenates all descendant text together.

Is my data uploaded anywhere?

No. Conversion happens entirely in your browser.

Dev ToolsXML Formatter & MinifierUses the browser's own XML parser to understand real element nesting, attributes, comments and CDATA sections, rather than a regex or brace-matching approach that would get self-closing tags and attribute quoting wrong.Dev ToolsCSV Formatter & CSV to TSV ConverterParses your data with a real RFC-4180-aware parser - so quoted fields containing commas, quotes or line breaks are handled correctly - then re-serialises it cleanly with consistent line endings and only the quoting that's actually needed.Dev ToolsJSON to CSV ConverterHandles the common case cleanly: a JSON array of flat objects becomes a CSV with a header row built from every key seen across all objects, and CSV converts back to an array of objects using the header row as field names.Dev ToolsJSON to XML ConverterUses one clear, disclosed convention in both directions: a JSON key becomes an XML element, arrays repeat that element, and an object key starting with @ becomes an XML attribute instead - since JSON and XML don't map onto each other in only one correct way.Dev ToolsCSV to XML ConverterUses the header row as column names by default, wraps every data row in a configurable row element, and sanitises column names that aren't valid XML element names rather than producing broken XML.Dev ToolsCSV Column ExtractorReads the actual header row from your CSV and shows a checkbox for every column found, so you pick by name rather than guessing column numbers - and the remaining columns keep their original left-to-right order.