Skip to content

Convert XML to CSV

Flatten the repeating records of an XML file into CSV rows, with attributes and nested elements as columns; the file is converted on your device.

Convert to
Drop an XML fileXML up to 100 MB · JSON, CSV, XLSX, XLS, ODS up to 500 MB
Choose fileProcessed on your device — never uploaded
Runs in your browser · no uploadHow it works

How to use XML to CSV

  1. 1

    Drop the XML file

    An export, a feed or a catalog — anything where the same element repeats once per record.

  2. 2

    Pick the row element

    The first repeating element is chosen for you; pick a deeper one from the list if you want one row per order line instead of per order.

  3. 3

    Shape the columns

    Keep or drop attributes, join repeated children into one cell or number them, and choose comma, semicolon or tab.

  4. 4

    Download the CSV

    Check the table preview, then download the .csv or copy it, with a UTF-8 BOM if Excel will open it.

Limits and Pro

XML files up to 100 MB, any number of records.

About XML to CSV

XML to CSV flattens a tree into a table. You say which element is one record — product, order, item, employee — and every occurrence of it becomes a row, in document order, wherever it sits in the file. The list of candidates shows each repeating element with its count, so you can tell catalog › product (240) from catalog › product › variant (1,130) at a glance.

Columns come from what each record contains. Attributes become columns under their own name (id, status); child elements become columns too, and deeper levels get dot names such as customer.address.city. An attribute of a child element is written as price.currency next to the price itself. Columns appear in the order they are first met, and a record that lacks one simply leaves that cell empty.

When a record repeats a child — three <author> elements in one <book> — you choose between one cell with the values joined by semicolons ("Ann; Bob; Cy") and numbered columns author.1, author.2, author.3, numbered the same way in every row so the columns line up.

The CSV follows RFC 4180: fields containing the delimiter, quotes or line breaks are quoted, lines end in CRLF. Pick a semicolon for spreadsheet programs set to a decimal comma, and add the UTF-8 BOM so Excel on Windows displays Cyrillic and accented letters properly. Values are written as text exactly as in the XML; the XML to Excel page types them instead.

Privacy

The XML file is parsed and flattened by a worker inside this browser tab; neither the XML nor the CSV is uploaded or stored.

XML to CSV: frequently asked questions

How do I choose which element becomes a row?
Use “One row per element”. It lists every element that occurs more than once under the same parent, with its path and count, shallowest first. The first entry is preselected, which is right for most exports; choose a deeper path when you want, say, one row per order line rather than one per order.
What happens to nested elements?
They become columns whose names follow the path from the record element: <customer><city>Tashkent</city></customer> becomes a customer.city column. Attributes at any level become columns as well, and if an attribute has the same name as a child element its column gets an @ in front, so neither value overwrites the other.
How are repeated tags inside a record handled?
By default their values share one cell, separated by a semicolon and a space. Choose “Numbered columns” to spread them over tag.1, tag.2 and so on; a tag that repeats in any record is numbered in all records, keeping the columns aligned. Numbered columns suit spreadsheets, joined cells suit reading or importing into a text field.
Why does Excel show broken characters when I open the CSV?
Excel on Windows assumes an old code page for CSV files that don't start with a byte-order mark. Turn on “Add UTF-8 BOM” before downloading and letters such as oʻ, ё or é show correctly. If your Excel uses a decimal comma, also choose the semicolon delimiter so columns split properly.
Can it convert XML with several kinds of records?
One element type is turned into rows per conversion. For a file holding both customers and orders, convert once with customer selected and once with order; the file stays loaded, so it takes a few seconds. Values from elements outside the chosen record, such as a document header, aren't repeated into the rows.

Other tasks with this tool