Developer / Formats
XML to CSV: Flatten XML Records into CSV
Convert repeated XML records into a table. Choose the record element, include attributes, preview the flattened columns and download CSV.
XML to CSV: Flatten XML Records into CSV: Each selected record element becomes one row. Attributes use @name, nested child paths become columns and repeated children are numbered with [1], [2] and so on. Missing fields become empty cells. Direct mixed text is kept under #text; surrounding whitespace is trimmed. Qualified element names are kept. DOCTYPE and ENTITY declarations are rejected. The converter supports up to 20 MiB of XML, 50,000 rows, 512 columns and 1,000,000 cells. Runs 100% locally in your browser with zero server file uploads.
- Category
- Developer tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
Choose the repeated element that represents one record. Child paths become columns, attributes use @name, and repeated children use [1], [2] and so on. Missing values are empty cells. Direct mixed text uses #text; surrounding whitespace is trimmed.
CSV formula protection adds an apostrophe to cells starting with =, +, - or @, including after whitespace. Turn it off only when you need the original cell text; spreadsheet applications may interpret it as a formula.
Limits: 20 MiB XML, 50,000 records, 512 columns, 1,000,000 cells and 64 nested levels. DOCTYPE and ENTITY declarations are not accepted.
XML records and names
The W3C XML specification defines elements, attributes and text (https://www.w3.org/TR/xml/). The table mapping uses element paths and retains qualified names. The starting catalogue is an original illustrative dataset released into the public domain.
Table output
ECMA-376 defines Office Open XML workbook packaging (https://ecma-international.org/publications-and-standards/standards/ecma-376/). RFC 4180 describes CSV quoting (https://www.rfc-editor.org/rfc/rfc4180). The download contains the flattened table rather than an XML mapping or embedded macros.
How to use it
- Paste an XML document or open a local XML file.
- Read the document, choose the record element and whether to include attributes.
- Check the first 100 rows and download the full table as CSV.
Privacy & limitations
Your inputs and files are processed in your browser. Nothing is uploaded.
Related tools
Frequently asked questions
Which element should I choose?
Choose the repeated element representing one record, such as /catalog/item. Selecting the document root instead creates one row containing the entire document’s child paths.
How are repeated child elements handled?
They become separate columns, such as tag[1] and tag[2]. A missing occurrence is an empty cell, and the converter does not multiply rows across nested lists.
Are attributes included?
Yes, by default. Turn the attribute option off to export only child text. Namespace declarations are omitted; other qualified names are preserved.
Does the output preserve the original XML structure?
No. It makes a flat table of attributes and text, so comments, processing instructions and the original ordering of mixed content are not retained. CSV formula protection is on by default and prefixes potentially executable cells with an apostrophe.
Free tool · runs in your browser · no account required