XML to CSV

Paste XML and get CSV at once, with errors pointed by line and column, then copy or download the result.

loading XML to CSV
About this tool

What are XML and CSV?

XML marks data with opening and closing tags and attributes; it is older than JSON and still the format of SOAP services, RSS, Office files and many government and banking integrations. CSV is a table in plain text: the first line names the columns and each following line is a row, with cells separated by commas (or semicolons, tabs or pipes).

Typical for opening a product feed, an export or an API response in XML as a spreadsheet: each repeated element (every <item>, <product>, <row>) becomes one row, and its attributes and child tags become the columns.

This page opens the data converter already set to XML → CSV. Paste the text, read the result as you type, then copy it or download it as a file. Errors show the line and the column. Nothing is sent anywhere: the conversion runs in your browser.

XML vs CSV

XMLCSV
Extension.xml.csv
Media typeapplication/xmltext/csv
Commentsyes (<!-- -->)no
Data typeseverything is text (types come from a schema)text only (numbers are a reading convention)
Nestingany depth, plus attributesnone: one flat table
Typical useSOAP, RSS, invoices, Office filesspreadsheets, exports, bulk imports
SpecificationW3C XML 1.0RFC 4180

When to convert XML to CSV

  • Convert to CSV when the data goes to a spreadsheet, a database import or a report.
  • Keep XML when a SOAP service, a feed or a legacy system expects XML.

What changes in the conversion

  • Comments of the XML file are not carried over: the converter reads the data, and comments are not data.
  • CSV is one flat table, so each repeated element (<item>, <product>, <row>) becomes one row; the header is the union of all their keys, and a nested element or list is written into its cell as JSON text. A document with a single element becomes a one-row table.
  • Attributes become keys starting with @ (@id), the text of an element that also has attributes becomes #text, repeated elements become a list, and numbers and booleans are recognized.

How to convert XML to CSV

  1. Paste your XML in the input box (the page opens with an example you can replace).
  2. Read the CSV on the right; it updates as you type. If something is wrong, the message says the line and column.
  3. Adjust the options if you need: indentation, sorted keys or type detection.
  4. Copy the result or download it as a .csv file.

Example

This XML input:

<?xml version="1.0"?>
<customers>
  <customer id="1"><name>Ana Souza</name><city>Recife</city></customer>
  <customer id="2"><name>Bruno Lima</name><city>Porto Alegre</city></customer>
</customers>

becomes this CSV, exactly as the converter writes it:

@id,name,city
1,Ana Souza,Recife
2,Bruno Lima,Porto Alegre

Frequently asked questions

Is my XML sent to a server?

No. Conversion happens in your browser, so secrets in a config never leave your computer.

Does XML to CSV keep comments?

No. Comments are dropped because the converter works on the data itself. Copy important comments by hand; CSV itself has no comment syntax.

What happens to nested data?

XML nesting: any depth, plus attributes. CSV nesting: none: one flat table. A nested value goes into its cell as JSON text.

Report a problem