Turn XML records into a clean CSV spreadsheet
The XML to CSV converter flattens repeating XML records — orders, products, bank transactions, RSS items, sitemap URLs, exported database rows — into a CSV file that opens straight in Excel, Google Sheets or LibreOffice Calc, or loads into a database. Paste XML or open a file and both the CSV and a preview table update as you type.
The tricky part of converting XML to CSV is deciding what one row is. This tool counts every element path and suggests the most frequent record-like element — one that has attributes or child elements — as the row. Its children and attributes become columns, deeper elements become dotted names such as address.city, and repeated children are joined into one cell or numbered across several.
Everything runs in your browser using its built-in XML parser; the file never leaves your device.
How to use the XML to CSV Converter
- Paste XML into XML input, drop a file on the box or press Open file.
- Check Rows from. The suggested element path is pre-selected and every path shows how many times it occurs; pick another if you want different rows.
- Choose how Repeated child elements are written, and whether to include attributes and keep namespace prefixes.
- Pick the delimiter and line endings, and keep UTF-8 BOM for Excel ticked if the file will be opened in Excel.
- Look over the Table preview, then press Copy or Download CSV. Swap sends the CSV to the CSV to XML converter.
XML to CSV Converter features
Row element suggested for you
Paths that repeat and carry attributes or child elements rank first, so orders/order is chosen over a leaf like items/sku even when the leaf occurs more often.
Nested data flattened
A child <city> inside <address> becomes the column address.city; an attribute on it becomes address.@type; the text of an element that has attributes keeps the element’s own name.
Repeated children your way
Join repeated values in one cell with “; ”, or give each its own numbered column — items.sku.1, items.sku.2 — which the CSV to XML converter turns back into repeated elements.
Excel-ready CSV
Comma, semicolon, tab or pipe; CRLF line endings as in RFC 4180; quotes only where needed (or everywhere); and an optional byte order mark so Excel shows ₹, £, é and ü correctly.
Live table preview
The first 100 rows appear as a table with the total row and column count, so you can spot a wrong row choice before downloading.
Entities, CDATA and namespaces
Entities such as & are decoded, CDATA is read as plain text, and prefixed names like pay:method are kept or shortened to method.
How each record becomes a row
Columns appear in the order they are first met. An empty container such as <items/> does not add its own column when other records have values inside it. Text outside the chosen row element — a report header, say — is not part of the table; convert the whole document with XML to JSON if you need it.
| Inside the row element | CSV column | Value |
|---|---|---|
id="A-1001" attribute | @id | A-1001 |
<customer>Priya Sharma</customer> | customer | Priya Sharma |
<total currency="INR">2499.00</total> | total and total.@currency | 2499.00 and INR |
<items><sku>BK-12</sku><sku>PN-03</sku></items> | items.sku, or items.sku.1 and items.sku.2 | BK-12; PN-03 |
<pay:method>UPI</pay:method> | pay:method, or method when prefixes are stripped | UPI |
| An element missing from some records | the same column, left empty | — |
Tips for opening the CSV in Excel
To check the XML before converting, use the XML Formatter. For a printable table rather than a spreadsheet, try XML to PDF.
- Accents or ₹ look garbled? Keep the UTF-8 byte order mark ticked. Without it, Excel on Windows assumes an older code page for CSV files.
- Everything lands in column A? Excel uses the list separator from your regional settings. In much of Europe that is a semicolon, so choose Semicolon as the delimiter.
- Leading zeros vanish? Excel turns
007or a PIN code like040001into numbers when it opens a CSV. Use Data → From Text/CSV and set those columns to Text; the CSV itself keeps the zeros. - Very long numbers change? Excel keeps only 15 significant digits, so 16-digit card or account numbers should also be imported as Text.
XML to CSV Converter FAQ
How do I convert XML to CSV?
Paste the XML or open the file, confirm the element under “Rows from”, and press Download CSV. The XML to CSV conversion and preview update automatically as you change options.
How does it decide what a row is?
It counts every element path. Paths that occur more than once rank first, then those with attributes or child elements, then the most frequent, then the shallowest. You can always choose another path from the list.
What happens to XML attributes?
Each attribute becomes a column named with an @, such as @id, or total.@currency for an attribute on a nested element. Untick “Include attributes” to leave them out.
How are repeated child elements handled?
By default their values are joined into one cell separated by “; ”. Choose “Numbered columns” to get tag.1, tag.2 and so on, which keeps each value separate and converts back to XML exactly.
Why does Excel show strange characters?
Excel needs a UTF-8 byte order mark to recognise UTF-8 in a CSV file. Keep “UTF-8 BOM for Excel” ticked, or import the file with Data → From Text/CSV and choose UTF-8.
Can I convert the CSV back to XML?
Yes. Press Swap to open the CSV in the CSV to XML converter with the same root and row element names; dotted and @ column names rebuild the nested elements and attributes.
Is my XML uploaded?
No. The file is read and converted by your browser, so exports with customer or financial data stay on your computer.