XML to CSV Converter
Extract XML data into flat CSV format with header auto-detection
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
- Paste XML into XML Input. Sample loads an employees list with an id attribute plus name, department, salary and country tags.
- Select an Output Delimiter: comma, semicolon, tab or pipe.
- 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.
- Press Convert to CSV. The stats bar shows row and column counts.
- 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