XML to CSV
This free XML to CSV converter turns XML into CSV entirely in your browser. Paste your XML or upload an .xml file, pick which element becomes a row, read the CSV, and download a .csv file. Nothing leaves your device, and there is no sign-up.
XML is a tree, CSV is a table, so every conversion has to answer one question before anything else: which element is a row? Most tools guess and never tell you what they guessed. Get that wrong and the table is wrong — too few rows, or columns that mix unrelated levels. This page lists every repeating element it found in your file, with how many times each one appears, and lets you choose. It then shows you the exact columns that choice produces, and reports every cell where it had to make a decision.
How to use this XML to CSV converter
- Paste your XML into the box, or upload an
.xmlor.txtfile. - Open Row element. It lists every element path in your document with its occurrence count —
catalog/product ×3, and so on. The most frequent one is pre-selected. - Choose what happens to Attributes: kept as
@namecolumns, or dropped. - Choose how Nested elements are handled: flattened into dotted column names (
tags.tag), only direct children, or kept as raw inner XML. - Choose how a Repeated child behaves: joined into one cell, or split into extra rows.
- Pick the Delimiter, the Quoting rule and the line endings, then press Convert to CSV.
- Open What this conversion decided under the output to read the column list, the cells that had to be quoted and why, and the fields that were missing.
What this tool supports
Picking the row element instead of guessing
The row element is the repeating element that becomes one CSV row. This page does not guess silently: it enumerates every element path in your document, counts it, and shows the list. A path that appears once is a container or a leaf; a path that appears many times is your data. Once you pick one, the header row, the row count and the column list are rebuilt for that choice only.
Where columns come from
| In your XML | Column it becomes | Note |
|---|---|---|
<name>Widget</name> | name | leaf element text |
<product id="A1"> | @id | attribute, marked with @ so it never collides with an element |
<tags><tag>metal</tag></tags> | tags.tag | nested element, flattened with dot notation |
| a field some records do not have | filled with an empty cell | the column set is the union of every record, in the order the columns first appear |
two <tag> children | one cell holding both, or extra rows | your choice under Repeated child |
Quoting, and why a cell gets quoted
CSV is not "values joined by commas". A value that contains the delimiter, a double quote, a line break, or leading and trailing whitespace has to be wrapped in double quotes, and any double quote inside it has to be doubled. This page applies that rule cell by cell and then lists every cell it quoted, with the reason.
| Value in your XML | Written as | Why |
|---|---|---|
Widget, large | "Widget, large" | it contains the delimiter |
Gadget "pro" | "Gadget ""pro""" | it contains a double quote, which is doubled |
| text with a line break | wrapped in quotes, break kept | it contains a line break |
padded | " padded " | it starts or ends with whitespace, which quotes preserve |
19.99 | 19.99 | nothing to escape, left bare |
Delimiters, line endings and Excel
Choose comma, semicolon or tab. If the file is going into Excel on Windows, switch line endings to CRLF and tick Add BOM so Excel reads UTF-8 correctly instead of guessing a legacy code page. Text values are written exactly as they appear in the XML — no number or date is reformatted, because CSV has no type system.
Privileges and limits
Parsing happens in your browser with the browser's own XML parser. No file is uploaded, nothing is stored after you close the tab, and there is no account. Because everything runs in your browser's memory, very large files (tens of MB) depend on your device; typical exports and feeds convert instantly.
What this tool does not do
- No XPath predicates. The row element is a chain of element names (
catalog/product). Filters such as[@type='x'], positional indexes and attribute conditions are not supported. - No namespace-aware matching. Namespace prefixes are part of the element name as written in your file. Strip them in your source if you need bare names.
- No XSLT or transformation language. This is a structural conversion, not a stylesheet engine.
- No merging of several files. One document at a time, no batch mode.
- No type conversion. Everything lands as text. Numbers, dates and booleans keep their original characters.
- It will not invent a row element. If nothing repeats, there is nothing to tabulate, and the page says so instead of producing a one-row table.
Frequently asked questions
Is this XML to CSV converter free?
Yes. No account, no sign-up, no conversion limit, and no upload — the work happens in your browser.
Is my XML uploaded anywhere?
No. The file you pick is read with the browser's own File API and parsed in the page. There is no request that carries your data.
How does it decide what a row is?
It does not decide — you do. The row element list shows every element path in your document with its occurrence count. Pick the one that represents a record and the table is rebuilt for it.
Why are some cells empty?
Because that record does not have that field. The column set is the union of all records, so a record missing a field gets an empty cell. The report lists which rows were missing which columns.
How do I get attributes into the CSV?
Leave Attributes on Include as @name. Each attribute becomes its own column named with a leading @, so id="A1" becomes the column @id.
A record has two values for the same tag. What happens?
By default they are joined into one cell separated by | , and the report counts how many cells were joined. Switch Repeated child to Split into rows and the record is written as several rows instead.
Why did a value get surrounded by double quotes?
Because it contains the delimiter, a double quote, a line break, or leading or trailing whitespace. Any double quote inside the value is doubled. The report lists each quoted cell with the reason.
My CSV looks wrong in Excel. What should I change?
Switch line endings to CRLF and tick Add BOM. If your locale expects semicolons, change the delimiter to semicolon.
Does it handle nested XML?
Yes. Nested elements are flattened into dotted column names such as tags.tag. You can switch to direct children only, or keep the raw inner XML as the value.
Is there a file size limit?
There is no imposed limit. Parsing happens in your browser's memory, so extremely large inputs (tens of MB) may be slow depending on your device. Typical exports and feeds convert instantly.
Why does it say my XML is not well-formed?
The message names the line where the parser stopped. Common causes are an unclosed tag, a stray &, or text outside the root element. Fix that line and it converts.
What if I need the other direction, or another format?
For the other direction use the CSV to JSON or Excel to CSV pages depending on your source. If you want the XML as JSON instead of a table, the XML to JSON converter keeps the tree, and JSON to XML goes the other way. To turn a table into a spreadsheet file, use CSV to Excel.