XML to CSV converter
Turn an XML file into a CSV. Repeated elements become rows, and your file never leaves your browser.
Drop an XML file here
Any XML file, up to 100 MB. It stays on your computer.
- No sign-up
- Nothing uploaded
- Comma, semicolon or tab
A CSV from your XML, made on your computer.
Your file stays on your computer
The CSV is written in your browser. Nothing is sent to Mammoth or anyone else.
Nested elements become columns
An element like name inside customer gets its own column, customer.name.
Commas stay inside their cell
A value like web, repeat is quoted, so it doesn't split into two columns.
How to convert XML to CSV
The converter finds the element that repeats, writes one line for each, and gives every child element and attribute a column.
- 1
Add your XML
Drop an .xml file on the box, choose one, or paste the XML in.
- 2
Check the rows
A preview shows the columns and the first rows of your CSV.
- 3
Download
Pick a separator and save the CSV, or take an Excel file instead.
Other ways to do it
If you write code, pandas can read XML too, one level at a time.
Python with pandas
Flat XML in a script
- Finds the repeating rows for youPartly
- Flattens nested elementsNo
- No code or installNo
- Runs on a scheduleYes
Copy and paste
A few short records
- Finds the repeating rows for youNo
- Flattens nested elementsNo
- No code or installYes
- Runs on a scheduleNo
- This page
This converter
Nested files, no setup
- Finds the repeating rows for youYes
- Flattens nested elementsYes
- No code or installYes
- Runs on a scheduleNo
How to convert XML to CSV in Python
pandas reads XML in one line. It reads a single level, so nested elements need their own path or this converter.
Want it in Excel instead? Excel can import XML with Power Query. The steps are on the XML to Excel page.
import pandas as pd
pd.read_xml("orders.xml", xpath="//order").to_csv("orders.csv", index=False)Needs the lxml package. A nested element like customer comes back as an empty column.
id,customer,total,paid 1041,,129.5,True 1042,,48.0,False
Your file stays private
The converter runs inside this page. Your XML is read and written out as CSV on your computer, and nothing is sent to Mammoth. That makes it safe for exports with customer or bank data in them.
Once the page has loaded, it works with your internet switched off.
Getting the same XML export every month?
Mammoth can take it from there. Put the converted CSV files in a folder and their rows are added to one table automatically.
Bank exports
| September | Sep 02 | Card payment | 64.20 | |
| September | Sep 15 | Transfer in | 2,400.00 | |
| October | Oct 03 | Direct debit | 118.00 | |
| November | Nov 01 | Card payment | 39.90 | |
| November | Nov 06 | Transfer out | 750.00 |
Illustration. Every new file in the folder is added to the same table.