RunToolRunRunToolRun
Tools/Converters/XML to CSV

XML to CSV

Convert XML files to CSV format.

100% on device ยท 0 uploads
Drop files here
or click to select ยท .xml
01 ยท Unlimited
Use it as many times as you want โ€” completely free.
02 ยท Private
Your files never leave your device; everything runs in your browser.
03 ยท Fast
Processing happens locally and finishes in seconds.

How to Convert XML to CSV

1

Paste your XML

Drop an .xml file or paste XML containing repeated records.

2

Records are flattened locally

Repeated elements are detected as rows and their child values become columns โ€” in your browser.

3

Download the CSV

Open the tabular result in Excel or import it into any data tool.

Flattening a tree into rows

XML is hierarchical and CSV is flat, so the first decision is which element becomes a row. An invoice document might yield one row per invoice or one row per line item, and those are different tables answering different questions.

Choosing the repeating element that matches your analysis is the whole job. Everything after it โ€” which fields become columns, how deeper levels are named โ€” follows from that choice.

Nested levels and repeated children

Fields nested below the row element become columns with compound names, which works while the nesting is shallow. Repeated children are harder: three addresses under one customer cannot become one row without either three sets of columns or three rows repeating the customer.

Repeating the parent across rows is usually the more useful shape for analysis, at the cost of duplicating the parent's data. It is the same trade a database join makes, and for the same reasons.

Attributes and text together

An element carrying both an attribute and a text value holds two pieces of information that must become two columns. Conversions that take only the text silently drop the attribute, which is a real data loss that produces no error.

Currency codes, units and language markers are the usual casualties, and they are exactly the attributes whose absence makes the numbers meaningless.

Inconsistent records

Optional elements mean different records carry different fields, so the header must cover the union of everything present. Records missing a field leave blanks, and a blank cannot say whether the element was absent or present and empty.

For counting and filtering, that difference frequently matters. If it matters for your analysis, it needs handling before the conversion rather than after.

Escaping on the way out

XML text can legitimately contain commas, quotation marks and line breaks, all of which must be escaped in CSV. A description field with an unescaped comma shifts every subsequent column in that row, and the file still opens โ€” simply wrong from that point on.

Checking a row containing free text, rather than the first three tidy rows, is the check that catches it.

What CSV cannot keep

Namespaces, schema types, comments, processing instructions and the document's structure all disappear. What remains is the values you selected, arranged as a table โ€” which is exactly what a spreadsheet or a statistics tool wants, and useless if you needed the structure.

Conversion runs in your browser, so financial and government XML feeds are not uploaded anywhere.

Checking the conversion before trusting it

Count the repeating elements in the source and compare against the data rows in the result. A mismatch means the wrong element was chosen as the row, or that records with a different shape were skipped rather than filled with blanks โ€” and both look like a perfectly ordinary file afterwards.

Then check one record you can verify by eye, end to end. XML feeds are usually machine-generated and highly uniform, which means an error affects either nothing or everything; a single carefully read row tells you which of the two you have.

Written by Mutaf โ€” Developer of RunToolRun. This section is written from the tool's own implementation.

Why Use This XML to CSV Converter?

โœ“Auto-detects record elements as rows
โœ“Direct path from XML exports to Excel
โœ“Standard-compliant quoted CSV output
โœ“100% local โ€” data stays private

Frequently Asked Questions

Which XML structures convert well?+
Record-style XML โ€” a repeated element (like <item> or <row>) whose children hold field values. That covers most exports, feeds and reports.
How are nested levels handled?+
Direct children of each record become columns. Deeper nesting is serialized into the cell โ€” for complex trees, convert to JSON instead.
Why CSV instead of JSON?+
CSV opens in Excel and imports into databases and BI tools directly. When the target is a spreadsheet or SQL table, CSV is the shortest path.
Is my data uploaded?+
No โ€” parsing and conversion run entirely in your browser.

Related Tools