Convert XML to CSV

Flatten XML records into a spreadsheet.

CSV

About this converter

The reason is usually a feed or an export that somebody needs to look at in a spreadsheet rather than in a text editor.

The repeated element in your document becomes the rows. Everything inside each one becomes a column, with nesting written as a dotted name and attributes kept as columns of their own rather than discarded — an attribute that decides what a record means should not vanish because it was written inside the tag instead of between them.

It works best on documents that are already a list of similar records, which most feeds and exports are. A document with a deep, irregular structure will produce a wide table with a lot of empty cells, because the columns have to be the union of everything that appeared.

Frequently asked questions

Which elements become the rows?

The repeated element inside your root — the , or that appears many times. If the root holds one list, that list is the table.

What happened to my attributes?

They became columns, named with an @_ prefix so they cannot collide with a child element of the same name. Dropping them is what most converters do, and it loses information that is often the point of the record.

Why is my table so wide?

Because the columns are the union of every field in every record, and XML does not require records to match. A document where each entry has different children produces a column for each one and blanks everywhere it did not appear.

Does what I paste get sent anywhere?

No. The conversion runs in your browser, on your own machine — which is why the result appears as you type. Nothing is uploaded and nothing is logged. That matters for this kind of tool in particular: config files and API responses are exactly the things that carry keys, hostnames and customer data.

Related tools