- Home
- CSV Converters
- XML to CSV Converter
XML to CSV Converter
Convert repeating XML records into a flattened CSV table
Convert record-oriented XML into a spreadsheet-ready CSV. The converter detects repeated sibling groups, suggests the most table-like group, and lets you choose a different record path when the document contains orders, items, products, or other nested lists. If nothing repeats, it flattens the root into one row.
Nested element names become dot-separated columns. For example, <products><product sku="A1"><name>Pen</name></product><product sku="B2"><name>Book</name></product></products> becomes two rows with @sku and name columns. Attributes on nested elements use names such as price.@currency.
XML can contain sparse fields, repeated tags, attributes, namespaces, and several unrelated lists. Missing fields stay blank, repeated leaf values can be joined with your chosen separator, namespace prefixes do not pollute headers, and the preview shows the mapping before download.
Drop your file here or browse from your device
Accepts XML. Maximum input: 10 MiB. Files above this hard limit are rejected before local processing.
How to Convert
- Upload an XML file or paste well-formed XML data
- Choose the repeating record path that should become CSV rows
- Set attribute, repeated-value, and output-delimiter options
- Check the table preview, then download the CSV or TSV file
Features
- Detect repeated record groups and let you choose the row path
- Flatten nested element names into dot-separated columns
- Optionally include XML attributes as @attribute columns
- Join repeated leaf values with a separator you control
- Export comma, semicolon, pipe, or tab-delimited output
- Build a shared header from every field found across the records
- Preview the flattened rows and columns before downloading
- Reject malformed XML with a visible parsing error
Use Cases
- Turn repeated records from an API response into rows for spreadsheet review
- Stage product, inventory, or order XML feeds for a CSV-based import
- Extract IDs stored in XML attributes alongside nested element values
- Convert an XML export into a tabular file for a database or analytics workflow
Frequently Asked Questions
Which XML elements become CSV rows?
The converter suggests a repeated sibling group, shows every detected record path with its record and field counts, and lets you choose the right one. If nothing repeats, it flattens the root into one row.
How are nested XML elements handled?
Nested paths become dot-separated headers relative to the selected record. For example, a city inside product and address becomes address.city.
What happens to XML attributes?
Keep the attribute option enabled to add columns such as @sku on the selected record or price.@currency on a nested element. Turn it off to export element text only.
What if records have different fields?
The converter builds one header from all fields it finds. A record that does not contain a particular element or attribute gets an empty cell in that column.
What happens when one record repeats the same tag?
Repeated leaf values stay in one cell and are joined with the separator you choose, rather than multiplying the whole record into duplicate rows.
Can it flatten several unrelated repeating lists?
You can select one detected record path per export. Convert another path separately when one XML document contains independent lists that should become different CSV tables.
Is the XML uploaded anywhere?
No. Parsing, flattening, preview, and CSV generation all happen in your browser.
Related Tools
CSV to XML Converter
Convert CSV files to well-formed XML
Sitemap to CSV Converter
Convert XML sitemaps to CSV with URL, lastmod, and priority columns
CSV to JSON Converter
Convert CSV files to JSON, NDJSON, or column arrays
CSV Viewer
View CSV files in a spreadsheet-style grid with sorting, filtering, and search