Convert XML to CSV

Runs on your device · Your file never leaves your device.

Drop an XML file of repeated records — <records><record>…</record>…</records>, an RSS feed, an export from a database — and get a CSV with one row per record. The document is read by the browser’s XML parser, then the list of repeated elements is found automatically: the converter walks down from the root through single-child wrappers until it reaches the list.

Each record is flattened the same way as in the JSON to CSV tool: nested elements become dot-separated columns (address.city), attributes become @-prefixed columns (@id), repeated inner elements get numbered columns, and the header row is the union of every column found. Fields with commas, quotes or line breaks are quoted to RFC 4180.

The CSV is UTF-8 with an optional byte-order mark for Excel, you choose the separator, and you can preview the first 200 lines before downloading. Nothing is uploaded.

How to convert XML to CSV

  1. Drop an XML file, or paste XML into the box.
  2. Pick the output separator and whether to add the Excel BOM.
  3. Press Convert to CSV and check the preview.
  4. Download the .csv.

Supported formats and limits

Input
XML (.xml) — a file or pasted text, UTF-8
Output
CSV, RFC 4180, UTF-8, optional BOM
Rows
The repeated element found below the root
Nesting
Child elements → dot columns; attributes → @columns
Where it runs
In your browser; nothing uploaded

Not for: Documents with several different lists at the same level — only the first list reached from the root becomes rows; convert to JSON first to pick another.

Frequently asked questions

Are my files uploaded to a server?
No. This conversion runs entirely inside your browser using your own device’s processing power. The file never leaves your computer or phone, which is why it also works when your connection drops.
How does it know which elements are the rows?
It starts at the root and follows single-child wrappers down until it finds a list of repeated elements — so <records><record>…</record></records> gives one row per <record>. If there is no repeated element, the whole document becomes one row.
Where do attributes go?
Into columns prefixed with @, so <record id="3"> produces a column named @id. Text beside child elements goes into a #text column.
Will Excel open it correctly?
Yes. The "Add a BOM for Excel" switch (on by default) writes the marker Excel needs to recognise UTF-8, so Arabic, accents and symbols display correctly.

More in Spreadsheets & data

Other ways to get a CSV

Related tools