XML to CSV converter
Convert XML to CSV: repeated elements (every <person> in <people>) become rows, with their child elements and attributes as columns, ready for Excel or Google Sheets.
What you get
- Convert XML to CSV online: repeated elements become rows and their child elements and attributes become columns.
- From XML to Excel or Google Sheets: download the .csv and open it, with comma, semicolon, tab or pipe delimiter.
- The root element and attributes around the rows are named in the result, so you know what is not in the table.
- Checked twice: the XML step by a full round trip, then the CSV parsed back and every cell compared.
- Private and free: everything runs in your browser, nothing is uploaded, and there is no sign-up.
How each result is checked
- Step 1: Your XML is checked for well-formedness first; errors show the line number.
- Step 1: The JSON is turned back into XML and parsed again, and every element and attribute must match the original.
- Step 1: Every word of text and every attribute value is also read from your XML independently, with its own reader, and must be in the JSON, so text cannot be dropped or left undecoded.
- Step 2: The CSV is parsed back, including quoted commas, quotes and line breaks.
- Step 2: Every cell is compared with the value it came from.
What can't convert exactly
- Number detection only converts values whose text stays identical, so 007, 1.50, 1e3, +1 and 20-digit IDs stay text.
- Comments are not carried over, and CDATA becomes plain text.
- Character references such as A or 😀 are decoded. HTML names such as are not part of XML; they are kept as text, and the result says so.
- In elements that mix text with child elements (<p>a <b>x</b> c</p>), JSON cannot keep the order of text and children: the text pieces are joined with a space into "#text", and the result names the element.
- Namespaces are kept: prefixed names such as soap:Body stay as they are, and xmlns declarations become "@_xmlns" keys.
- CSV is text only: numbers and booleans are written as text and null becomes an empty cell.
- Arrays inside a row are written as JSON text in one cell.
- When rows have different keys, all keys become columns and missing values are left empty.
- An object that wraps one list, such as {"data": [...]} or the root element of an XML file, is unwrapped: the list becomes the rows, and the result names where they were found and any single values left out beside them.
Questions
How is a two-step conversion checked?
Your input is converted to JSON first, then to the target format. Each step has its own independent check, and both must pass. The checks of both steps are listed under every result.
Is my data uploaded?
No. Everything runs in your browser, in a background worker. Nothing is sent to a server.
How do I open an XML file in Excel?
Convert the XML to CSV here: repeated elements become rows and their children become columns. Download the .csv file and open it in Excel; use the semicolon delimiter if your Excel expects one.
How do I convert XML to CSV online?
Paste your XML or open a file on the left (or click Example). The CSV appears on the right as you type, already checked. Copy it, or download it as a file. Nothing is uploaded.
Can the CSV output be wrong?
Every result is checked before it is shown (the checks are listed on this page). If a check fails, the page says "Review needed" and why, instead of presenting the output as correct, and anything that cannot convert exactly is named in the notes.