Back to Tools

XML to CSV Converter

Extract XML data into flat CSV format with header auto-detection

🔍 Auto Headers📋 Flat Export
XML Input

Open XML records in a spreadsheet

XML exports from HR systems, product catalogs and legacy software are hard to filter or sort. This converter reads pasted XML, treats each direct child of the root element as one record, and lays the fields out as a CSV table with a header row. The XML is parsed by your browser's built-in parser, so malformed input is caught before anything is produced.

How to convert

  1. Paste XML into XML Input. Sample loads an employees list with an id attribute plus name, department, salary and country tags.
  2. Select an Output Delimiter: comma, semicolon, tab or pipe.
  3. Leave Include Attributes ticked if attributes on each record, such as id, should become columns marked with an at sign, for example @id. Tick Quote All Fields to wrap every value in double quotes.
  4. Press Convert to CSV. The stats bar shows row and column counts.
  5. Use Copy or the CSV download button, which saves output.csv.

How rows and columns are chosen

Rows come from the elements directly under the root. Columns are the union of every attribute (when included) and child element name found across all rows, in the order they first appear. If one record lacks a field that others have, its cell is simply empty. Values are trimmed. Without Quote All Fields, quotes are added only when a value contains the delimiter, a double quote or a line break.

Example situations

  • Loading a supplier's XML product feed into Excel for a price comparison.
  • Turning an XML export of user accounts into a file for a bulk import that takes CSV.
  • Sorting and filtering records that arrive as one long XML document.
  • Checking which fields vary from record to record in a data feed.

Know the limits

The converter is designed for a flat structure: a root with repeated records that each contain simple child elements. If a child itself has nested elements, its column receives the combined text of everything inside it rather than separate columns. If a record contains several elements with the same name, only the last one is kept. Attributes on nested child elements are ignored; only attributes on the record element are used. Invalid XML displays an alert with the first parser message, and a root with no child elements displays a warning instead of output. Files with namespaces work, but prefixed tag names appear as they are written.


Related Tools

Related Tools


Frequently Asked Questions

How does the tool decide what counts as a row?
Every element directly beneath the root element becomes one row. If your document wraps the records one level deeper, for example inside a records or items container, the whole container becomes a single row, so paste only the level that repeats.
What does Include Attributes do?
Attributes on each record element are added as extra columns, with names starting with an at sign, such as @id. Untick it if you only need the values from child tags. Attributes on deeper elements are not collected.
What happens if records have different fields?
The header row contains every field name found in any record. Records that lack a particular field get an empty value in that column, so the table stays rectangular and imports cleanly into spreadsheet software.
Why is one of my columns missing repeated values?
When a record holds several child elements with the same tag, such as multiple tag entries, only the last one is kept because each name becomes a single column. Restructure the XML or process those repeats separately if you need all of them.
What if my XML is not valid?
The browser's XML parser rejects it and an alert displays the first line of the error message, so no CSV is produced. Common causes are unclosed tags, unescaped ampersands and mismatched case between opening and closing tags.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.