XML to CSV Converter
Convert XML to CSV - free, no upload.
Expects one root element containing repeated row elements, each with simple child elements as columns - the shape this site's own CSV-to-XML tool produces. XML attributes and deeply nested elements aren't turned into columns.
What this tool does
Paste XML with repeated row elements under one root, and get back a CSV with the union of every row's child element names as columns.
Converts repeated-row XML to CSV, using the union of every row's child element tag names as columns.
Fills a missing column with an empty CSV cell rather than shifting the remaining values out of position.
Reports the real parser error if the XML isn't well-formed.
Scoped explicitly to the common repeated-row XML shape rather than attempting a general, unpredictable flattening of arbitrary XML.
Treats every direct child of the root element as a row, whatever its tag name is, rather than requiring all rows to share one specific tag.
Pulls a cell's value from the first matching child element by tag name if a row has more than one child with the same tag.
How to use it
- Paste your XML.
- The result appears automatically.
- Copy or download the CSV.
Why use this converter
Row-like XML is awkward in spreadsheets. Flattening repeated elements into columns makes it filterable and sortable.
Why we built it
We built the XML to CSV converter for the common repeated-row shape, rather than promising to flatten arbitrary XML unpredictably. Inspect the source with the XML formatter and tidy the output with the CSV formatter.
Who this tool is for
- Analysts opening XML feeds in a spreadsheet
- Developers converting exports
- Admins moving data between systems
When to use it
- Opening XML exports in a spreadsheet.
- Preparing data for analysis.
- Converting feeds.
- Inspecting records.
Why this is scoped to one specific XML shape
There's no single row-oriented convention across all XML documents.
XML can represent data in far more shapes than a spreadsheet's rows and columns can express - deeply nested structures, mixed content, and attribute-heavy documents all need different flattening rules. Rather than guessing at a general-purpose flattening scheme that would behave unpredictably on unusual documents, this tool targets the specific, common repeated-row shape directly and is upfront that other XML shapes aren't supported.
What happens with repeated tags and nested content inside a row
Two edge cases inside a row element are worth understanding before you rely on the output.
Two children with the same tag name
Column values are found by searching a row's direct children for the first one whose tag matches each column name. If a row happens to have two children with the same tag - two <phone> elements, say - only the first one's text ends up in that column; the second is silently ignored rather than becoming an extra column or an extra row.
Text inside a grandchild element still shows up
Columns come from a row's direct children only, so a grandchild element - something nested one level deeper - never becomes its own column. But its text isn't dropped: this tool reads each column's value with the browser's own textContent, which recurses into every descendant and concatenates all their text together. So if a child element itself contains nested child elements, the text inside those nested elements still appears in the parent's cell, just run together rather than split into separate columns.
| Row XML fragment | What ends up in the CSV |
|---|---|
| <row><tag>A</tag><tag>B</tag></row> | Column "tag" = "A" (the second <tag> is ignored) |
| <row><addr><city>NYC</city></addr></row> | Column "addr" = "NYC" (city's text, not a separate column) |
What you give it, and what you get back
| Item | Details |
|---|---|
| Input | XML with repeated row elements. |
| Output | CSV with a column for each child element. |
| Notes | Missing values are empty cells. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| Attributes are missing | Only child elements become columns. | Move values into elements first. |
| Nested data is missing | Grandchildren are not flattened. | Flatten the XML first. |
| An error message appears | The input is not valid for this format. | Fix the problem the message points to. |
Assumptions and limitations
- Only child elements become columns - XML attributes on the row or its children are not included.
- Deeply nested elements (grandchildren of a row) are not flattened into columns.
- Every row's columns come from a single flat pass over its direct children, in the order those tags first appear.
Frequently asked questions
How do I convert XML to CSV for free?
Paste XML with repeated row elements under one root element, and the CSV is built automatically.
What XML structure does this expect?
One root element containing repeated row elements, each with simple child elements as columns - the same shape this site's CSV-to-XML tool produces.
Are XML attributes included as columns?
No - only child elements become columns.
What happens if one row is missing a column another row has?
That cell is left empty in the output rather than shifting the remaining values out of position.
What if a row has two child elements with the same tag name?
Only the first one's text is used for that column - the second matching element is ignored rather than creating an extra column or row.
Does text inside a nested (grandchild) element get included?
Yes, indirectly - it isn't given its own column, but its text is still pulled into its parent's cell because the value is read with textContent, which concatenates all descendant text together.
Is my data uploaded anywhere?
No. Conversion happens entirely in your browser.