XML to CSV converter
Paste an XML file such as a product or order list and each record becomes a row, each field a column.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter xml text, repeating element name (optional) and delimiter.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
The record element is the most repeated element that has attributes or children, or the name you type. In each record an attribute becomes an @name column, a child element a column with its name, deeper elements path columns such as d/e. Repeated values in one column are joined with "; ". Fields are quoted per RFC 4180.
Example
Inputs: Delimiter = Comma ,. Result: CSV: @id,@lang,title,author,price 1,ar,مقدمة ابن خلدون,ابن خلدون,45 2,en,Arabian Sands,Wilfred Thesiger,60; Record element: book; Rows: 2.
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<book id="1" lang="ar">
<title>مقدمة ابن خلدون</title>
<author>ابن خلدون</author>
<price>45</price>
</book>
<book id="2" lang="en">
<title>Arabian Sands</title>
<author>Wilfred Thesiger</author>
<price>60</price>
</book>
</catalog>@id,@lang,title,author,price 1,ar,مقدمة ابن خلدون,ابن خلدون,45 2,en,Arabian Sands,Wilfred Thesiger,60
Limits and caveats
- Auto detection may pick the wrong element in complex files, type the record element name in that case.
- Repeated children inside one record are merged into one cell separated by "; ", not split into rows.
Questions about this tool
How do I open the result in Excel?
Copy the text and save it as a .csv file. If your Excel uses semicolons, choose the semicolon delimiter.
What are the columns starting with @?
They are tag attributes, so id in <book id="1"> shows up in a column named @id.
What if records have different fields?
Every field seen in any record becomes a column, and the cell stays empty for records that lack it.
