XML to CSV Converter
Flatten XML into rows and columns: the repeated record element becomes the rows, nested elements and attributes become dotted columns, and the result opens cleanly in Excel or Google Sheets.
XML to CSV Converter
Runs in your browser — nothing you enter is uploaded or stored.
Scratchpad auto-saved
How it works — in four simple steps
No signup and nothing to install — it all runs in your browser.
Add your XML
Paste it into the left box, press Open file, or drag a .xml file onto it. Sample loads a realistic example.
Set the options
Adjust the options above the boxes — the output updates instantly as you change them.
Check the result
Read the status line: it reports rows, keys and any value that couldn't be represented in CSV.
Copy or download
Copy the CSV or download it as a .csv file. Nothing was uploaded at any point.
Opening in Excel on Windows? Tick UTF-8 BOM so accents and symbols display correctly.
Features
Attributes kept, clearly marked
XML attributes become keys with an @ prefix (or _ / - / none), so they never collide with child elements of the same name.
Real types, not just strings
Numbers, booleans and empty values are detected — while codes with leading zeros such as 00742 or +44 phone numbers stay text.
Namespace control
Keep prefixes like dc:title, or strip them to get plain keys when the namespaces don't matter to you.
Stable array shape
Optionally make every child element an array, so code doesn't break when a list happens to have only one entry.
Nested data flattened
Nested objects become dotted columns (address.city), and arrays of plain values are joined so every row fits the grid.
Any output delimiter
Comma for most tools, semicolon for European Excel, tab or pipe when your data is full of commas.
Private by design
Parsing and conversion run in your browser with JavaScript — your data is never uploaded, logged or stored.
About the XML to CSV Converter
To turn XML into a table, a converter needs to find the records — the element that repeats. In a product feed it's <product>, in a sitemap <url>, in an RSS feed <item>. This tool parses the XML into a tree and walks down from the root until it reaches the first list of repeated elements; those become the rows. If there's no repetition at all, the whole document becomes a single row.
Each record is then flattened. Child elements become columns, nested elements become dotted column names (address.city), and attributes become columns with the attribute prefix (@id), so nothing is lost. When a record contains a list of plain values — several <author> elements, say — they are joined into one cell with semicolons; a list of complex elements is kept as JSON text in its cell. Columns are the union of all records, so a field that appears in only some records still gets a column.
The CSV is written to RFC 4180: fields containing the delimiter, quotes or line breaks are quoted and inner quotes doubled. For Excel on Windows, tick UTF-8 BOM so accented characters display correctly, and choose semicolons if your Excel uses a comma as the decimal separator.
Examples
A sitemap.xml is a list of repeated <url> elements — exactly the shape that becomes a clean table.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://toolfeather.com/</loc>
<lastmod>2026-10-20</lastmod>
<priority>1.0</priority>
</url>
<url>
<loc>https://toolfeather.com/tools/xml-to-csv/</loc>
<lastmod>2026-10-21</lastmod>
<priority>0.8</priority>
</url>
<url>
<loc>https://toolfeather.com/blog/</loc>
<lastmod>2026-10-18</lastmod>
</url>
</urlset>loc,lastmod,priority
https://toolfeather.com/,2026-10-20,1
https://toolfeather.com/tools/xml-to-csv/,2026-10-21,0.8
https://toolfeather.com/blog/,2026-10-18,This output was produced by the converter on this page with the default options — load it with the “Sitemap” preset above and change any option to see the effect.
How XML maps to CSV
| In XML | Becomes in CSV |
|---|---|
Repeated element, e.g. <book> ×N | N rows |
Child <title> | column title |
Attribute isbn="…" | column @isbn |
Nested <address><city> | column address.city |
Several <author> values | one cell: Kernighan; Ritchie |
Text plus attribute <price cur="USD">45</price> | columns price.@cur and price.#text |
| Element missing in some records | empty cell in those rows |
Things that trip people up
- The wrong records are picked. The first repeating list found from the root is used. If your file has a small repeated header list before the main records, delete it or convert the relevant fragment only.
- Deeply nested lists. A table can only have one level of repetition. Lists inside records are joined or stored as JSON in a cell; for full fidelity convert to JSON instead.
- Numbers in Excel. Excel may reformat long numbers (IDs of 16+ digits become 1.23E+15) and strip leading zeros when it opens a CSV. Use Data → From Text/CSV and set those columns to Text.
- Namespaces in column names. Tags like
g:pricein Google Merchant feeds produce columns namedg:price. Tick Strip namespace prefixes for plain names.
XML vs CSV at a glance
| Property | XML | CSV |
|---|---|---|
| Specification | XML 1.0 Fifth Edition (W3C, 2008) | RFC 4180 (2005) |
| File extension | .xml | .csv |
| Media type | application/xml (RFC 7303) | text/csv |
| Data types | text only (types come from a schema) | text only — every cell is a string |
| Comments | Yes <!-- --> | No |
| Nesting | Unlimited | None (flat rows) |
- XML: A document has exactly one root element; element names can't start with a digit, and only five entities (& < > " ') are predefined.
- CSV: Fields containing a comma, a double quote or a line break must be wrapped in double quotes, and a quote inside is written twice ("").