XML to CSV

Transform data from XML format to CSV.

About XML to CSV

SOAP responses, RSS feeds, product feeds and exports from older systems arrive as XML, which spreadsheets cannot open as a table. This tool reads an XML document whose root element contains a list of records, takes the child elements of the first record as column names and writes one CSV row per record with every value quoted.

Paste the XML, name the file and download the CSV. Parsing uses the browser's built-in DOMParser, so the document is processed locally and never leaves your computer.

How to use XML to CSV step by step

  1. Paste the XML document into the text area. The root element must contain the records as direct children, for example <products><product>...</product></products>.
  2. Type the name of the CSV file (data by default).
  3. Click "Convert and download CSV". If the XML is malformed you get a parsing error instead of a file.

Input and output example

Input

<users>
  <user><id>1</id><name>Ana</name><city>Madrid</city></user>
  <user><id>2</id><name>Luis</name><city>Sevilla</city></user>
</users>

Output

id,name,city
"1","Ana","Madrid"
"2","Luis","Sevilla"

Why use our XML to CSV?

Common use cases

Limits and tips

Frequently asked questions

What XML structure is required?

A root element whose direct children are the records, each record holding its fields as child elements with text. Feeds like RSS need a small adjustment because the items sit under <channel>, one level below the root: paste the <channel> element as the root instead.

Why do I get an XML parsing error?

The document is not well-formed: an unclosed tag, an unescaped & or < in text, a missing root element, or a stray byte order mark. Validate the XML in an editor or online validator, fix the reported line and try again.

What is the difference between XML and CSV?

XML is a hierarchical markup format with named tags, attributes and nesting, designed for document and data interchange between systems. CSV is a flat table of delimited values without structure beyond rows and columns. CSV is far smaller and opens in any spreadsheet; XML carries richer structure and validation via schemas.

Are attributes converted?

No. Only the text content of child elements becomes a column. If important data is stored in attributes, transform the XML first, for example with an XSLT or a search-and-replace that turns attributes into elements.

Is the XML uploaded to a server?

No. The document is parsed by the DOMParser built into your browser and the CSV is generated locally. Nothing is transmitted.

Related tools

Other free utilities you may find useful

Available languages