XML to CSV Converter
Turn a repeating XML structure into a spreadsheet-ready CSV, with nested elements flattened and attributes kept as columns.
About this conversion
Import from File
Drag & drop a file here
or
Supports .txt, .csv, .log, .json and other text files
Conversion runs entirely in your browser. CSV cannot represent nesting or repeated elements, so this is a faithful export rather than a reversible transformation.
What It Does
XML nests and CSV does not, so the conversion is really two decisions: which element is a row, and how everything beneath it becomes columns. This picks the repeating element automatically — the one that appears many times under a common parent, which is what item, book or entry usually is — and lets you override it when a document has more than one candidate. Everything under that element is flattened into dotted column names, so a nested author element with a name inside becomes author.name and the original path stays visible. Attributes become columns too, which matters more in XML than people expect: the identifier you most want to join on is frequently an attribute rather than a child element.
When to Use It
- A supplier sends a product feed as XML and you need it in a spreadsheet to review before importing.
- An API returns XML and you want the data in a form you can pivot, sort and filter.
- A legacy export needs loading into a database and your import tooling only accepts CSV.
- You want to see how many records an XML file actually contains and what fields they carry.
- A sitemap or RSS feed needs auditing and reading it as a table is far faster than reading the markup.
Worked Examples
<catalog><book id="1"><title>XML Basics</title><price>29.99</price></book><book id="2"><title>Advanced XML</title><price>49.99</price></book></catalog>
The clean case. Book is the repeating element so it becomes the row, and the id attribute becomes a column alongside title and price — without it you would lose the identifier entirely.
<items><item><name>Widget</name><supplier><name>Acme</name><country>UK</country></supplier></item></items>
Nesting flattened. The supplier element becomes supplier.name and supplier.country, keeping the path visible so the original structure is still readable from the header row.
<feed><entry><title>First</title><tag>a</tag><tag>b</tag></entry></feed>
A repeating child inside a row. The two tags join into one cell rather than becoming columns, because the count varies per row and a table needs a fixed width.
Features
How to Use
1. Paste your XML or import a file. 2. The tool picks the repeating element and shows you which one it chose. 3. Override it if your document has several candidates. 4. Check the column list — attributes appear alongside child elements. 5. Copy the CSV or open it in a spreadsheet.
Common Mistakes
- Assuming the tool can guess the row element in an ambiguous document. If several elements repeat, only you know which one is a record — check the choice rather than trusting it.
- Losing attributes. Many converters ignore them entirely, which silently drops the identifier that most XML formats put in an attribute rather than a child element.
- Flattening deeply nested data. Beyond two or three levels the column names become unreadable, which is a signal the data is not naturally tabular.
- Reading empty cells as an error. XML does not require every record to carry every element, so gaps are usually the data being honest rather than the conversion failing.
- Expecting a faithful round trip. CSV cannot represent nesting, repeated children or attribute-versus-element distinctions, so converting back will not reproduce the original document.