Skip to content

XML to CSV

Flatten a repeating XML element into a CSV table with a header row.

Input
Output

XML to CSV

Paste an XML document and this tool finds the element that repeats — the one representing each row of data — and turns every occurrence into a CSV row, with a header built from its sub-elements and attributes. It is built for exports from APIs, CMS feeds, e-commerce catalogs and legacy systems where XML is the only format on offer but a spreadsheet is where the data actually needs to go.

By default the repeating element is detected automatically, but you can name it yourself when a document has more than one plausible candidate. Nested sub-elements become columns joined by the path separator, so <address><city> turns into a column named address.city; turn off "Include attributes" to drop XML attributes from the output entirely. When a row has more than one of the same sub-element — several <tag> children, say — choose whether to join their values into a single cell or spread them across separate numbered columns.

Quoting defaults to wrapping a field only when it contains the delimiter, a quote character or a line break, keeping simple output easy to read; switch to "Always" for tools that expect every field quoted. The delimiter can be a comma, semicolon, tab or pipe, and "UTF-8 with BOM" adds the byte-order mark that makes Excel read accented text correctly instead of guessing an encoding. Malformed XML is reported with the line where parsing stopped.

Everything runs locally in your browser — the XML you paste is never uploaded or sent to a server, so exports containing customer or business data stay private. Copy the CSV, download it as a .txt file, or send it straight back into the input to run another tool on it.

FAQ

How does the tool decide which element is a row?
It picks the element tag that repeats most often in the document. If your XML has more than one repeating tag, turn off auto-detect and type the element name yourself.
What happens to nested elements?
They are flattened into a single column using the path separator, so <address><city> becomes a column named address.city by default.
How are repeated child elements inside one row handled?
Choose "Join into one cell" to combine their values with a semicolon, or "Separate columns" to spread them across numbered columns like tag.1, tag.2.
Can I open the result in Excel without broken accented characters?
Yes. Set Encoding to "UTF-8 with BOM" — Excel then reads the file with the correct character set instead of guessing.
Is my XML uploaded anywhere?
No. The conversion runs entirely in your browser, so your document never leaves your device.