XML to CSV Converter

Extract the repeating records from an XML document into CSV rows, with attributes and nested elements flattened into columns.

XML
CSV
Runs locally in your browser

About the XML to CSV Converter

Most XML data files have one element that repeats: <book>, <row>, <item>, <record>. The converter finds the first such collection, treats each occurrence as a row, and builds columns from the union of its attributes and child elements. Nested children are flattened into dotted column names, so price.@currency and price.#text both appear.

Values that look numeric are written as-is, text is quoted only when it contains the delimiter, quotes or line breaks, and the header row lists columns in the order they were first seen. Choose the semicolon delimiter for spreadsheets in locales that use a comma as the decimal separator, or tab to paste directly into a sheet.

When a document has no repeating element the whole document becomes a single row. If the converter picks the wrong collection, cut the document down to the parent of the records you need and convert that fragment.

How to use

  1. Paste the XML on the left.
  2. Choose comma, semicolon or tab to match the program that will open the file.
  3. Download the CSV or copy it into your sheet.

Common questions

How does it decide which element is a row?
It looks for the first element that repeats under the same parent. Each repetition becomes one row.
What if records have different children?
The header is the union of all children, so a record without a given child gets an empty cell.
Can I include attributes as columns?
Yes, they are included automatically with the prefix you set, for example @id.