Toolvore

XML to CSV

Convert a selected XML record path to CSV, keeping attributes, namespaces and repeated fields.

This tool processes its input contents in your browser instead of sending them to a processing service. Page, asset and fixed usage-measurement requests are described on the Privacy page.

Convert a selected XML record path to CSV with separate attribute, repeated-element and namespaced columns.

How to use it

  1. 1Paste UTF-8 XML or choose a local file.
  2. 2Convert and review the suggested record path, namespace mapping and preview.
  3. 3Choose formula protection, reconvert if changed, then download CSV.

Example

Input
<items><item id="A1"><name>Notebook</name></item><item id="B2"><name>Pen</name></item></items>
Output
record/@id,record/name[1]/#text[1] A1,Notebook B2,Pen

Record path /items/item; attributes become explicit columns.

What happens to your data

XML, filenames and CSV values stay in browser memory. DTDs, custom entities, URL imports and XPath are not executed.

Last updated November 2026

Turn a chosen set of XML records into a CSV table without uploading the source. A record-path selector makes the row boundary explicit. Attributes receive their own columns, repeated child elements receive numbered columns, and namespace aliases keep different XML names distinct. A preview explains the mapping before you download.

How it works

For pasted XML, select Convert to CSV. Choosing a UTF-8 XML file up to 4 MiB converts it immediately using the suggested record path. The browser's XML parser checks well-formedness after a preflight rejects DTDs, custom entity declarations, processing instructions and unsupported character encodings. Only predefined XML entities and numeric character references are permitted. No URL importer, XPath execution, XML stylesheets or remote resource fetching is implemented.

The first repeated element path near the root is selected as a starting suggestion; inspect it and choose another exact path from the document when necessary. Only elements at that path become rows. Their descendants become columns prefixed record/. Attributes use @, children always have occurrence indexes such as tag[1]/ and tag[2]/, and direct text and CDATA use #text[1], #text[2]. Text whitespace is preserved after normal XML parsing: character references are decoded and XML line-ending and attribute-whitespace normalization apply. Namespace URIs receive stable aliases n1, n2 and so on within this conversion, listed in the mapping details. Prefix spelling from the input is not treated as namespace identity.

This preserves mapped scalar values without silently joining repeated values, but CSV is a table projection rather than an XML round trip. Missing elements and empty strings both produce empty cells. Comments and namespace declarations are omitted from the CSV; namespace aliases are shown separately. Elements outside the selected record path are excluded. The preview shows the first 10 rows and 300 characters per cell; the download includes every mapped row and full permitted cell value.

The limits are 30,000 elements and attributes combined, 32 element nesting levels, 256 attributes per element, 1,000 distinct element paths, 5,000 records, 256 columns, 200,000 cells, 100,000 characters per cell and 16 MiB exported CSV. A limit stops the entire conversion. Quoting follows ordinary CSV rules with doubled quotes, comma separators and CRLF row endings.

Spreadsheet formula protection is enabled by default. A cell starting, after optional whitespace/control characters, with =, +, - or @ receives an apostrophe prefix. This changes the exported value, including negative numbers represented as text. Turn the option off and reconvert only when exact values are needed and you trust the XML; the unprotected export can trigger spreadsheet formulas. Preview cells display the original mapped values, while the count reports protected cells. Input, file names and converted values stay in browser memory and are excluded from fixed usage telemetry.

Common use cases

  • Exporting product records with IDs stored as XML attributes
  • Keeping repeated tags in separate numbered columns
  • Converting namespaced records without mixing identical local names from different schemas
  • Preparing a reviewable CSV from a trusted UTF-8 XML export

Frequently asked questions

Which XML node becomes a CSV row?+

Each element at the selected exact record path becomes one row. The automatic suggestion favors a repeated path near the root; review its count and select a different path if the record boundary is different.

What happens to repeated child elements?+

Each occurrence gets a numbered path, such as record/tag[1]/#text[1] and record/tag[2]/#text[1]. Values are not silently joined with a delimiter. Extra occurrences can increase the column count and trigger its explicit limit.

Can I recover the original XML from the CSV?+

No. The conversion omits comments and namespace declarations, excludes unselected records and represents missing and empty values as empty cells. It is an explicit table projection, not a lossless XML serializer.

Why does an exported value have an apostrophe?+

Formula protection prefixes formula-like cells so a spreadsheet is less likely to execute them. The interface reports the changed-cell count. Turn protection off and reconvert for exact values only when the input is trusted.

Can this load XML from a website or resolve external entities?+

No. Choose a local UTF-8 file or paste source text. DTDs, custom entity declarations, processing instructions and URL imports are rejected or unavailable. The parser never needs network access to convert supported input.