XML to CSV / Excel Converter
Records out of any XML file, flattened into columns, and tables back into XML.
Try before you buy.
- Free preview: the structure and the first rows of the table made from your XML (up to 10), or the first lines of the XML made from your table (up to 20).
- Locked until you unlock it: download and copy.
- Unlock: Pro pass, ₹179 for 30 days, a one-time payment that never renews.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Your XML
Any XML: exports, feeds, RSS or Atom, sitemaps, KML. For large files use Open a file: any size works there.
Your table
A CSV, TSV or Excel file, or cells pasted from a spreadsheet. The first row names the elements.
Or paste the table (from Excel, Google Sheets or a CSV)
Records
Problems in the XML
From the root (/catalog/book), or // for an element at any depth (//item).
The table
Save
XML
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the XML to CSV / Excel Converter
Get the records out of an XML file and into a spreadsheet. Open or paste XML — an export, a product or job feed, RSS or Atom, a sitemap, KML places, a SOAP response — and the element that repeats is found for you (/catalog/book, /rss/channel/item, /urlset/url): each one becomes a row, and everything inside it becomes columns named by their path — attributes as id or price/@currency, child elements as title or author/name. Children that repeat inside a record (several authors, several categories) are joined in one cell or get a column each. With a pass the table saves as CSV, TSV or Excel; the free preview shows its first rows.
It works the other way too: a CSV or Excel table becomes XML, with the root and row element names you choose, columns as child elements or attributes (@id columns are always attributes), nested elements from column names such as address/city, and every value escaped as XML requires. Column names that are not valid XML names are made valid, and the page says which.
Files of any size are read piece by piece in your browser (gzip-compressed ones too), and mistakes in the XML are listed with their line and column. Without a pass, the free preview shows the structure and the first rows of the table, or the first lines of the XML; the files and copying unlock with a Pro pass.
How to use it
- Choose XML to table, then paste your XML or open an .xml (or .xml.gz) file. Try an example loads a small book catalogue.
- Check Rows are: the repeating element the page found, with how many records and fields it has. Pick another one from the list, or type a path such as
/feed/entryor//item(an item at any depth). - Choose how repeated children are written, whether to drop namespace prefixes (
dc:creator→creator), and CSV, TSV or Excel. With a pass, or after unlocking this result, press Download or Copy; the free preview shows the first rows. - For the other direction choose Table to XML, paste or open a CSV or Excel file, set the root and row names and how columns are written, and check the XML before you save it.
Examples
<catalog> <book id="b1"><title>XML & You</title><author>Asha</author><author>Ravi</author><price currency="USD">29.95</price></book> <book id="b2"><title>Second</title><author>Li</author><price currency="EUR">9.50</price></book> </catalog>
id,title,author,price/@currency,price b1,XML & You,Asha; Ravi,USD,29.95 b2,Second,Li,EUR,9.50
id,name,address/city,@type 1,Asha & Co,Pune,vip
<?xml version="1.0" encoding="UTF-8"?>
<rows>
<row type="vip">
<id>1</id>
<name>Asha & Co</name>
<address>
<city>Pune</city>
</address>
</row>
</rows>Common uses
- Opening a product feed, an export or an API response in Excel.
- Turning RSS or Atom feeds, sitemaps or KML placemarks into a list.
- Comparing or filtering XML data in a spreadsheet, then writing it back as XML.
- Making the XML file an importer asks for from a spreadsheet.
How the rows and columns are found
The file is read once to count every element path: how often it occurs, how often it repeats under one parent, and which children and attributes it has. The element that repeats and holds the most fields becomes the row — usually what a person would pick — and the others are offered in the list. Paths use XPath’s short notation: /catalog/book starts at the root, //item means an item at any depth (XPath 1.0).
Inside each record, every attribute and every element with text is a column named by its path from the record. The record element’s own attributes have plain names (id) unless a child element has the same name (then @id). An element that has both text and child elements keeps its own text in a #text column. Spaces around text are trimmed, as XML files are usually indented.
What is checked in the XML
The reader follows XML 1.0: one root element, matching start and end tags, attribute values in quotes and each attribute once per tag, no < inside a value, the five predefined entities (< > & ' "), character references such as  , and entities the document’s DOCTYPE declares. Mistakes are listed with their line and column, and the rest of the file is still read where it can be. Nothing is ever fetched: external DTDs and entities are not loaded, and documents whose entities expand without limit are refused.
Writing XML from a table
Each row becomes one element under the root. Columns are child elements or attributes; a column whose name starts with @ is an attribute, and address/city writes a <city> inside an <address>. Values are escaped (& < > in text, also " and line breaks in attributes), characters XML 1.0 does not allow are left out, and names that are not valid XML names — 1st name, my field — become valid ones (_1st_name, my_field). The CSV side follows RFC 4180.
Limitations
- XML files of any size are read; each record is read whole, so a single record must fit in memory. Gzip files are unpacked as they are read.
- Records are flat rows: a deeply nested record gives many columns, and lists inside lists are joined. Mixed text such as
Hello <b>world</b>keeps its own text and its children’s text in separate columns. - Only internal DOCTYPE entities are read; DTD validation, XML Schema, XInclude and namespaces beyond their prefixes are not applied.
- Tables turned into XML are read whole: CSV files up to 100 MB and workbooks up to 50 MB.
- Excel sheets hold at most 1,048,576 rows and 16,384 columns; choose CSV for more.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What do I get without a pass?
Without a pass, XML to CSV / Excel Converter shows the structure and the first rows of the table made from your XML (up to 10), or the first lines of the XML made from your table (up to 20). Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.
How do I convert XML to CSV?
Paste the XML or open the file, check that Rows are names the element that repeats (it is chosen for you), and choose CSV. With a pass, press Download. Without one, the free preview shows the first rows of the table.
How do I open an XML file in Excel?
Convert it here and choose Excel (.xlsx): numbers become Excel numbers (codes with leading zeros, such as 007, stay text) and the first row holds the column names, frozen.
My XML has records at different depths. What do I do?
Type //name under Rows are, for example //entry: every element with that name becomes a row, wherever it is. A record inside another record belongs to the outer one.
Why does it say my XML has errors?
XML is strict: a missing end tag, an & written as itself instead of &, an HTML name such as , or an attribute without quotes makes a file invalid. Each mistake is listed with its line and column; fix it in the file, or check whether the rows read are still what you need.
Can I turn a spreadsheet into XML?
Yes. Choose Table to XML, paste the cells or open the CSV or Excel file, and set the names. Column names such as @id become attributes and address/city nested elements.
Is my file uploaded?
No. It is read and converted in your browser.