Skip to content
migration.tools
XML to CSV

XML to CSV converter

Pull the repeating records out of an XML file into a flat CSV. The converter finds the repeated element for you — items in a feed, rows in an export — and makes one row per record.

Going the other way? CSV to XML

Options

XML

CSV

The result appears here as soon as there is input.

Processed on this device. Nothing you paste or drop is uploaded.

How to use it

  1. 1Paste your XML or drop a file onto the input panel.
  2. 2Adjust the options — the result updates as you type.
  3. 3Copy the CSV or download it. Drop several files to convert a batch into one ZIP.

How XML becomes CSV

A table needs rows, so the converter first finds the list of records in your XML — the top-level array, or the largest array of objects nested inside it — and makes one row per record.

Nested objects are flattened into dotted column names (address.city), arrays inside a record are written as JSON text in a single cell, and the header is the union of every key that appears in any record, so sparse data lines up correctly.

XML and CSV, briefly

XML describes documents with nested elements and attributes. It still runs enterprise integrations, SOAP services, product feeds, sitemaps and many government and banking formats.

CSV is the lowest common denominator for tabular data: every spreadsheet, database and import wizard reads it. It has no types and no nesting, and details such as the delimiter, quoting and encoding vary between programs.

Questions

How are XML attributes and repeated elements handled?

Attributes are kept as keys prefixed with @ (for example @id), element text that sits next to attributes goes under #text, and elements that repeat become arrays. You can drop attributes entirely with one switch.

Will the CSV open correctly in Excel?

Yes. Fields containing commas, quotes or line breaks are quoted the way Excel expects. If accented characters look wrong, turn on the UTF-8 BOM option; for European locales where Excel expects semicolons, change the delimiter.