XML to CSV Converter
This XML to CSV converter reads a document, treats the root element as the container, and turns the repeated child elements inside it into rows — the employee elements inside employees, for example. Child elements become columns, and attributes are kept rather than discarded: each becomes its own column prefixed with @_, so an id attribute is still there in the spreadsheet. Deeply nested elements are expanded into dot and index columns so no value is lost. You can paste XML or upload a file, and the conversion happens entirely in your browser.
How it works
The root element is treated as the container, and the repeated child elements inside it become rows. Attributes are kept and appear as columns prefixed with @_, so nothing in the document is silently dropped.
Nested objects and arrays become dot and index columns (address.city, tags[0]) so nothing is lost. Turn off expansion to keep each nested value in a single cell as compact JSON.
The conversion runs entirely in your browser — nothing you paste or upload is sent to a server.
How to convert XML to CSV
- Paste your XML, or upload an
.xmlfile. - The repeated child elements inside the root become rows, and their children become columns.
- Download the
.csvand open it in any spreadsheet.
How rows are identified
XML has exactly one root element, which acts as the container rather than as data. The repeated elements directly
inside it — the <employee> elements inside <employees>, for example — become
the rows. If the document holds a single record instead of a list, you get a one-row table with a column per
field.
Attributes are kept
Attributes are data too, so they are not discarded. Each one becomes its own column, prefixed with
@_ to keep it distinguishable from a child element of the same name — so
<employee id="1"> produces an @_id column holding 1.
Common use cases
- Turning a vendor's XML export into a spreadsheet for review.
- Extracting a product or inventory feed into a table.
- Moving legacy XML data into a system that imports CSV.
Frequently asked questions
How do I convert XML to CSV?
Paste your XML into the left panel or upload an .xml file. The rows appear on the right as CSV, ready to copy or download and open in a spreadsheet.
How does it decide what becomes a row?
XML has exactly one root element, which acts as a container rather than as data. The repeated elements directly inside it become the rows, so employee elements inside an employees root produce one row per employee.
Are XML attributes included in the output?
Yes. Attributes are data too, so each becomes its own column prefixed with @_ to keep it distinct from a child element of the same name. An element written as employee id="1" produces an @_id column holding 1.
What if my XML has deeply nested elements?
Nested elements are expanded into dot-separated columns, and repeated nested elements into indexed columns, so every value keeps a column of its own instead of being flattened away.
What if the document holds a single record rather than a list?
You get a one-row table with a column for each field, which is still the correct representation of the data.
Is my XML file uploaded to a server?
No. Files you choose are read directly in your browser and parsed locally, so the contents never leave your device.
Related tools
XML to JSON Converter
This XML to JSON converter parses XML into JSON online, preserving attributes and repeated tags as arrays.
CSV to XML Converter
This CSV to XML converter turns each row into an element, with column names made valid automatically.
XML to YAML Converter
This XML to YAML converter maps elements to keys and repeated elements to lists, with real types.