XML to CSV Converter
Convert XML files to CSV, JSON, Parquet, Excel, and more. Parses any XML with repeating row elements, such as REST API exports, database dumps and legacy data files. Everything runs in your browser.
Drop an XML file here
or click to browse · .xml only
How to use the XML to CSV Converter
- Drop an .xml file onto the drop area, or click it to browse. Only files ending in .xml are accepted.
- Check the summary. It shows the root element, the row element the tool picked, the number of rows found, and a tag for every column.
- Scroll down to the preview to see the first 200 rows as a table.
- Choose an output format: CSV, JSON, Parquet, TSV, NDJSON or Excel.
- Click Download. The file is named after your XML file, so orders.xml downloads as orders.csv.
Worked example
An order export where each order has attributes and child elements, and only one order has a note.
Input (orders.xml)
<?xml version="1.0" encoding="UTF-8"?>
<orders>
<order id="1001" status="shipped">
<customer>Alice</customer>
<total>25.5</total>
</order>
<order id="1002" status="pending">
<customer>Bob</customer>
<total>12</total>
<note>Gift wrap</note>
</order>
</orders>Settings
- Export as: CSV
Output (orders.csv)
@id,@status,customer,total,note
1001,shipped,Alice,25.5,
1002,pending,Bob,12,Gift wrapEach <order> becomes one row. The id and status attributes become the @id and @status columns. Each child element becomes a column named after its tag. Only the second order has a <note>, so the first row leaves that field empty.
How XML elements map to CSV columns
- Each repeating record element is one row, even when it sits inside wrapper elements. The summary shows which element was used.
- Only the direct children and attributes of each record are read. A deeper element with the same name as a column never fills that column.
- The column list is the union of every attribute and child tag found across all rows. Missing values are left empty.
- Attributes become columns named with an @ prefix. Child elements become columns named after their tag.
- If a record repeats a child tag, such as two <phone> elements, only the first value is kept.
- A record with no child elements, such as <price currency="USD">10</price>, keeps its text in a column named after the record.
- Text written directly inside a record element next to child tags is not included.
Frequently Asked Questions
What shape of XML does this converter expect?
Any XML where one element repeats as the records, such as <orders> containing many <order> elements. The records do not have to sit directly under the root. In <response><items><item>, each <item> becomes a row. The tool picks the outermost element that repeats under a shared parent and has its own fields. Repeated plain values inside a record, such as two <phone> tags, do not count as records. If nothing repeats, each child of the root becomes a row.
How are XML attributes handled?
Every attribute on a record element becomes its own column. The column name is the attribute name with an @ in front, so id="1001" becomes a column called @id. This keeps attributes apart from child elements with the same name.
Does it handle namespaces such as <ns:item>?
Yes. Prefixed names are kept as written, so <ns:title> becomes a column called ns:title and an ns:id attribute becomes @ns:id. Namespace declarations (xmlns and xmlns:ns) are not turned into columns.
What happens to nested elements?
They are not split into separate columns. A child element that has its own children becomes one column holding all of the text inside it, joined together. If you need nested values as separate columns, export to JSON and restructure, or flatten the XML before converting.
Why do some numbers look different in the CSV?
After parsing, column types are detected. Columns that hold only numbers are read as numbers, so 25.50 is written as 25.5. A code with leading zeros, such as 007, can lose them if the whole column looks numeric. Check ID and postcode columns in the preview before you export.
Is my XML file uploaded to a server?
No. The file is parsed by your browser and converted on your device. Nothing leaves your computer.
Related tools
CSV to XML
Go the other way: turn a CSV file into XML records.
JSON to XML
Convert a JSON array of records into XML.
HTML Table to CSV
Extract an HTML table and save it as CSV.
CSV Viewer
Open the converted CSV and browse it as a table.
SQL Query Tool
Run SQL against the converted file. Filter, join and aggregate.
Data Profiler
Check row counts, column types and null rates.
CSV to Parquet
Compress tabular data into a columnar Parquet file.