XML to CSV
Text never leaves this browserPaste a list in XML and download a CSV, or paste a CSV and download XML. Repeating sibling elements become rows, and attributes are kept as columns named @id and similar. This is not the XML pretty-printer, and it is not the JSON to CSV page. The work runs in this tab, so the text is never uploaded.
How to use it
- Choose XML to CSV or CSV to XML. Paste text, drop a file, or try the two-order sample.
- For XML to CSV, pick a comma, semicolon or tab delimiter. Leave the header row on unless you only want the data. Turn on the UTF-8 BOM if you will open the file in Excel.
- For CSV to XML, set the root and row element names (the sample uses orders and order). Columns named @id become attributes; item.@sku becomes an attribute on a child element.
- Copy the result or download a .csv or .xml file.
Details
- Rows
- If the children of the root (or of a single wrapper) share one element name, each of those elements is a row, even if there is only one
- Attributes
- An attribute is a column named @name, or parent.@name when it sits on a child element
- CSV to XML
- The first row is the header. @ columns become attributes on the row element. Nested names such as total.@currency rebuild a child element
- Limits
- Up to 5 MB. DOCTYPE and external entities are rejected. This is not a schema-aware mapping, and mixed or deeply nested XML may need a warning
Questions
Are my files uploaded?
No. The page loads its code once, then reads and processes your files inside the browser tab. Nothing is sent to a server; you can confirm it in your browser's network panel while a file is processed.
How is this different from the XML formatter?
That page checks well-formedness and pretty-prints or minifies XML. This page turns a list of records into a table, or a table back into XML. The two jobs are different, and that page is not changed here.
How is this different from JSON to CSV or CSV to JSON?
Those pages convert between JSON and CSV. This page starts from XML, or writes XML. A JSON array of objects is a different shape, so those pages stay separate.
What happens to attributes and nested elements?
Attributes become columns named @id, @status and so on. A child element becomes a column with that element’s name. An attribute on a child is named like item.@sku. Repeated simple children in one record are joined with a pipe.
Will every XML document become a tidy table?
No. The tool is built for a list of similar records — orders, books, rows. If several different element names repeat under the root, it uses the most common one and tells you what was skipped. Deep or irregular trees may need another tool.
Is there an API?
Yes. The MCP tool xml_to_csv on this site can convert XML to CSV or CSV to XML. The text is not stored.