XML to CSV
Turn an XML document into a CSV table of its records. The tool finds the repeated element that represents a row — or you name it yourself — then flattens each record into columns: attributes become @name columns, nested elements join with dots, and repeated values are written as JSON. Column order follows first appearance and every row is padded, so the output opens cleanly in any spreadsheet. Everything is converted on your device.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
How the records are chosen
Row detection counts same-named children at every depth and takes the element name that occurs most often; with no repetition it falls back to the children of the document element, or to the document element itself. Naming a record path — book, catalog.book or /catalog/book — overrides detection and may be written from the root or relative to the document element.
How one record becomes one row
A record is flattened into column names and cells. Attributes become @id-style columns, nested elements join with a dot so author.name is one column, and an element holding both children and text keeps its text under its own column name. Values repeated inside one record are written as compact JSON, since a single CSV cell cannot carry the same column twice.
Delimiters, headers and attributes
delimiter switches between comma, semicolon, tab and pipe, and the chosen character is what triggers quoting. Turning header off removes the first line, and turning includeAttributes off discards every @-column before the header is built. Any cell holding a quote, the delimiter or a line break is quoted, with inner quotes doubled.
Caps, padding and privacy
Each run accepts up to 2,000,000 characters and 50,000 records; empty input, a document with no tag, or a record path matching nothing is refused instead of emitting an empty file. The header is the union of all columns seen, in first-appearance order, and short rows are padded with empty cells. Comments and processing instructions are skipped rather than validated, so malformed nesting is read as written, and the document is never uploaded.
Questions
How are columns named?
Attributes become @id, @type and so on. Nested elements join with a dot, so <author><name> is the column author.name. When an element holds both attributes and text, the text goes in a column named after the element itself.
What happens when records have different shapes?
The header is the union of every column seen, in first-appearance order. Rows that lack a column are padded with an empty cell.
How are repeated child elements handled?
Values that appear several times inside one record are serialized as compact JSON in that cell, because a single CSV cell cannot repeat a column.
Is the original XML uploaded anywhere?
No. Parsing happens in your browser and no network request is made. Only local files or pasted text are read.
Related tools
See categoryXML ⇄ JSON Converter
Convert XML documents into JSON and JSON back into XML.
CSV to JSON
Parse CSV (RFC 4180) into a JSON array, with delimiter sniffing and type inference.
JSON to CSV
Turn a JSON array of objects into CSV, with delimiter, header, and flatten options.
CSV Profiler
Profile a CSV file: per-column type inference, missing values, unique counts, and numeric stats.