How to Convert XML to CSV
XML feeds, exports and API responses often hold row-like data buried in nested tags — and getting that into a spreadsheet by hand is painful. This converter does it automatically. It parses your XML with a real parser, spots the repeated record elements under the root, and turns each one into a CSV row. Child elements become columns, attributes become their own prefixed columns, and every record is unioned so entries with slightly different fields still line up with blanks for the gaps. Fields containing the delimiter or quotes are quoted the RFC-4180 way. Pick a comma or semicolon, then copy or download. Everything runs in your browser, so nothing is uploaded.
Paste your XML
Paste your document or load the sample; it's parsed locally with nothing uploaded.
Choose the options
Pick the delimiter and toggle whether attributes become columns.
Copy or download
Grab the CSV with one tap or save it as a .csv file.
XML vs CSV — What's the Difference?
XML — Extensible Markup Language
A tag-based, hierarchical format where data lives in named elements that can nest and carry attributes. It's self-describing and powerful, but it isn't tabular, so spreadsheets can't read it directly — the row structure is implied by repeated elements.
CSV — comma-separated values
A flat, universally supported table format where each line is a row and commas separate columns. Converting XML to CSV flattens those repeated elements into explicit rows and columns that any spreadsheet or database can open.
Common Use Cases
XML exports to spreadsheet
Turn an XML data export into CSV you can open and analyse in Excel.
Feed & catalog data
Flatten product feeds or catalog XML into rows for review.
Legacy system output
Convert XML from older systems into CSV for modern tools.
Reporting
Move XML records into a spreadsheet-based report or dashboard.
Data migration
Prepare XML data as CSV for import into a database.
European locales
Use semicolon output for CSVs that open correctly in comma-decimal regions.
Bulk review
See many XML records as a grid to spot gaps and errors.
Quick inspection
A fast, no-install way to see what row data an XML file contains.
Tips & Best Practices
Structure XML as repeated records
A root wrapping many same-named elements converts most cleanly — each becomes a row.
Decide on attributes
Turn attributes on to keep ids and metadata as columns, or off for a cleaner element-only table.
Pick the right delimiter
Use commas for most tools; switch to semicolons if your spreadsheet uses a comma as the decimal separator.
Flatten deep nesting first
Deeply nested child elements are kept as markup in a cell; flatten them if you want separate columns.
Keep consistent tags
Consistent child element names across records keep the columns tidy.
Troubleshooting
It says the XML is invalid
XML must be well-formed: tags balanced and closed, one root element, and special characters escaped. Fix any unclosed tags and try again.
Only one row appears
The root probably doesn't contain repeated same-named elements, so the whole document is treated as a single record. Wrap your records in a common parent.
Attributes are missing
Turn on 'Include attributes'. They appear as columns with an @ prefix so they never clash with element names.
A cell contains markup
That field had nested child elements, which are kept as XML so nothing is lost. Flatten the nesting for separate columns.
Frequently Asked Questions
How do I convert XML to CSV for free?
Paste your XML above and CSV appears instantly. Copy it or download a .csv file — free, no signup.
How does it decide what a row is?
It looks for repeated same-named elements directly under the root and treats each one as a row. If there's no repetition, the whole document becomes a single record.
What becomes a column?
Each record's child elements become columns, and — if enabled — attributes become their own columns with an @ prefix.
What if records have different fields?
Every field across all records becomes a column, and any record missing a field gets a blank cell so the table stays aligned.
Are attributes included?
Yes, when 'Include attributes' is on. Turn it off for a cleaner table built only from element content.
Are commas and quotes handled in the CSV?
Yes. Any field containing the delimiter, a quote or a line break is wrapped in quotes and inner quotes are escaped.
Can I use a semicolon delimiter?
Yes. Choose semicolon output for spreadsheets and locales that use a comma as the decimal separator.
What happens to deeply nested elements?
Nested child elements are kept as XML inside the cell so no data is lost; flatten them beforehand for separate columns.
Will the CSV open in Excel?
Yes. The output imports cleanly into Excel, Google Sheets, Numbers and any CSV-aware tool.
Is my data sent to a server?
No. Everything happens inside your browser, so your data never leaves your device.
Can I download the result?
Yes. Save the output as a .csv file, or copy it straight to your clipboard.
What if my XML is invalid?
The tool validates your input and shows a clear message if the XML isn't well-formed.
How large a document can it handle?
It comfortably converts sizeable XML documents with many records, all in your browser.
Does it handle namespaces?
Namespaced tags keep their prefixes as part of the column names, so the structure is preserved.
Does it work on phones?
Yes, in any modern browser on Windows, Mac, Android or iPhone with nothing to install.
Is this converter really free?
Completely free, forever — no account, no ads and no premium wall.
100% free · No signup · Processed in your browser · Data never sent
Last updated: August 2026 · FlipMyFormat XML to CSV Converter
Written and maintained by the FlipMyFormat team · Runs entirely in your browser