XML to CSV Converter

XML to CSV Converter reads repeated elements, attributes, and nested values into one table.

Use this tool

Output CSV format

Parsed table

Result

The result appears in this panel after you run the tool.

About this tool

Repeated elements become rows. Attributes use an @ prefix, nested elements use dotted paths, and a repeated child uses indexes such as tag[1]. Include header row writes those names first. The serialized CSV is the file you copy, download, or continue with.

How to use it

  1. Paste XML, including a declaration or a fragment with several top-level elements.
  2. If several row collections are equally valid, choose Rows from. Then set the output delimiter and header.
  3. Use Convert. Copy, download, or continue with the serialized CSV.

Limitations

A record list chosen, then flattened

This parser is not the one that builds JSON

The table path parses XML without fetching a DTD, strips a doctype first, and keeps every value as text. Attributes are prefixed with @ rather than @_. Text that sits with attributes can become a #text column. A zero-padded code stays zero-padded, unlike the XML-to-JSON parser, which may turn the same digits into a number. Comments and the declaration are not columns. Whitespace in text is collapsed. A fragment with several roots can be wrapped so it still parses, and the wrapper is discarded.

The flattener then looks for a list of records or a map of records. Repeated sibling elements that are objects become rows, and their attributes and text become columns. When one collection is the obvious table, it is chosen. When two collections tie, you pick the path. Nested objects inside a row become dotted columns. Lists of scalars become numbered columns starting at one. Empty and null-like absences become empty cells. There is no nested cell. Indentation is discarded. The relationship “this element contained that element” survives only as a column name.

The output dialect is a second choice

Separator, quote, escape, and the header switch belong to the destination. The header row is the column paths, including @ names, when the switch is on. Turning it off writes cells without those names. A spaces separator is emitted as a comma. The preview may show fewer rows and columns than the copied text. The full rectangle is the result.

Information that has no column

Mixed content order, comments, and the difference between an empty element and a missing element are weak or absent. A document that is one narrative with inline tags is a poor table. A document that is a repeated record with attributes and simple children is the shape this page expects. JSON conversion of the same XML will not match this CSV’s types or attribute prefix. Treat the two conversions as different projections.

Privacy

Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.