XML to CSV Converter

Your XML stays in this browser.

Paste a flat XML table with up to 1,000,000 characters. Conversion happens in this browser.

Convert a simple XML table into comma-separated CSV without sending its contents anywhere. The converter expects one root containing direct row elements with the same name. Row attributes become columns such as @id, while direct child elements become ordinary columns. It deliberately rejects nested or ambiguous XML instead of guessing how to flatten it.

How to convert flat XML to CSV

  1. 1

    Paste the XML

    Enter well-formed XML of up to 1,000,000 characters. DOCTYPE and ENTITY declarations are rejected.

  2. 2

    Check the table shape

    Every direct child of the root must be the same row element, with attributes and unique direct text fields only.

  3. 3

    Review rows and columns

    The second step shows the detected table size before you create the export. Limits are 10,000 rows and 200 columns.

  4. 4

    Copy or download

    Copy the comma-separated CSV or download it as UTF-8, then start over to clear the local draft.

Accepted XML shape

The root must contain one or more direct row elements, all with the same element name. Each row may have attributes and direct child elements whose contents are plain text:

<contacts>
  <contact id="1">
    <name>Ada</name>
    <city>London</city>
  </contact>
  <contact id="2">
    <name>Lin</name>
    <city>Taipei</city>
  </contact>
</contacts>

This becomes:

@id,name,city
1,Ada,London
2,Lin,Taipei

Attributes use an @ prefix so they remain distinct from child elements. A field missing from one row produces an empty cell.

What is rejected

  • Invalid XML, an empty root, or a document with no row elements
  • A DOCTYPE or ENTITY declaration
  • Different row element names under the same root
  • Child fields that contain nested elements
  • The same child field repeated within one row
  • More than 1,000,000 input characters, 10,000 rows, or 200 columns

The converter does not offer XPath, namespace controls, upload, an API, nested-data flattening, explode or join strategies, alternate separators, or a BOM option. Reshape hierarchical XML into a flat table before using it.

CSV output and spreadsheet safety

The output uses commas and UTF-8. CSV quoting keeps commas, quotes, and line breaks inside their fields. Values beginning with =, +, -, or @ are protected so spreadsheet software reads them as text rather than formulas. Review the downloaded data before importing it into another system.

Browser-local privacy

Parsing, validation, preview, copying, and download all happen in your browser. XML and CSV content are not uploaded, sent through Livewire, placed in the URL, or saved to a server-side history. The three-step flow may keep one private local draft for the page session; Start over clears it. Do not paste sensitive data on a device you do not trust.

Frequently Asked Questions

No. It accepts only a root with uniform direct row elements, whose direct child elements contain text rather than further elements. This strict shape avoids an arbitrary or misleading flattening result.

Each row attribute becomes a column prefixed with @, such as id="7" becoming @id. Direct child elements use their element names as columns.

It produces comma-separated UTF-8 CSV. There are no controls for another separator or a BOM. Values that could begin a spreadsheet formula are protected as text.

No. The input and result stay in the browser and do not enter the URL or server history. Start over clears the local draft used by the three-step flow.

Related Tools