XML to CSV Converter — made simple
Paste your XML or upload a feed, get a clean CSV file ready for Excel, Google Sheets, or any spreadsheet app. Auto-detects the structure and handles attributes.
What is an XML to CSV converter?
An XML to CSV converter parses a well-formed XML document and produces a CSV file where each repeating element becomes one row, and each child element or attribute becomes a column. XML's hierarchy is flattened into a table that opens directly in Excel, Google Sheets, or any BI tool.
XML (eXtensible Markup Language) is the older cousin of JSON. It dominated web services in the 2000s and is still the lingua franca of enterprise systems: SOAP APIs, RSS/Atom feeds, Microsoft Office file formats, configuration files, and countless legacy data feeds. The structure is verbose but precise — every field has explicit start and end tags, attributes are first-class, and schemas can enforce the entire shape of the document.
The challenge: most modern data tools (Excel, Google Sheets, SQL databases, BI platforms) want a flat table, not a tree. An XML to CSV converter bridges the two — it walks the XML tree, picks a "row element" (usually the most common repeating child of the root), and emits one CSV row per occurrence with the child elements and attributes as columns.
How to convert XML to CSV in 3 steps
Most conversions take less than a minute. No login, no upload to a server, no installation.
-
Paste or upload
Drop a
.xml,.rss, or.atomfile into the upload zone, or paste XML text. The converter auto-detects the row element (the repeating child of the root). -
Choose options
Open the settings cog to decide whether to include attributes, how to flatten nested elements, and which delimiter to use. Live preview updates as you change options.
-
Download
Click Download CSV to save the file. Open it directly in Microsoft Excel, Google Sheets, Numbers, or any spreadsheet app.
Built for the XML you actually have
Real XML has attributes, namespaces, mixed content, and nesting. HopConvert handles all of it.
Auto-detect row element
Sniffs the document and picks the most likely repeating element. Override in settings for tricky schemas.
Attributes as columns
Include XML attributes as columns prefixed with @. Toggle off in settings if you'd rather ignore them.
Nested-element flattening
Child elements become columns with a separator. address/city becomes address__city. Configurable.
Browser-only privacy
Every byte is processed in your browser. Nothing is uploaded, logged, or stored on our servers.
RSS / Atom support
Standard feed formats are recognised automatically.
Custom delimiters
Comma, tab, semicolon, or pipe. Tab is best for Excel paste; semicolon for EU locales; pipe for data with embedded commas.
XML vs CSV: what's the difference?
Both store structured data, but they're designed for very different jobs.
| Aspect | XML | CSV |
|---|---|---|
| Structure | Hierarchical (nested elements, attributes) | Flat tabular (rows and columns) |
| Best for | Enterprise APIs, document formats, configuration, RSS | Spreadsheets, BI tools, human analysis, databases |
| File size | Largest (verbose tags) | Smallest (plain text) |
| Human readability | Moderate (tag noise) | High (opens directly in Excel) |
| Schema support | Strong (XSD, DTD) | None (implicit from header) |
| Attributes | First-class | Not supported |
| Namespaces | Supported | Not supported |
When teams reach for XML to CSV
XML is still everywhere in enterprise, and CSV is what most data tools want. The bridge is XML to CSV.
RSS / Atom feeds
Convert a blog or news feed into a spreadsheet to track publishing, monitor topics, or feed into a research tool.
SOAP API responses
Many enterprise APIs still use SOAP. Convert the response XML to CSV to import into a database or BI tool.
Microsoft Office files
Word, Excel (older formats), and PowerPoint all use XML internally. Extract data from .docx or .xlsx packages.
Configuration files
Maven, Ant, Spring, and countless other tools emit XML configs. Convert to CSV for human review or documentation.
Legacy data exports
Older ERP, CRM, and accounting systems often export only XML. Convert to CSV before importing into modern tools.
Scientific data
Many scientific formats (SBML, KML, GML) are XML. Researchers use CSV conversions for analysis in R, Python, or Excel.
XML to CSV: the complete guide
Everything you need to know about the XML format, the CSV output, and how to handle real-world documents.
How is XML structured?
XML is a tree of nested elements, each with optional attributes and text content. A document always has exactly one root element; everything else is a descendant of the root. Here's a minimal example:
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<book id="1">
<title>The Pragmatic Programmer</title>
<author>Andy Hunt</author>
<year>1999</year>
<price>42.50</price>
</book>
<book id="2">
<title>Clean Code</title>
<author>Robert Martin</author>
<year>2008</year>
<price>38.00</price>
</book>
</catalog>
The tree structure is what makes XML powerful — you can represent arbitrary relationships — but it's also what makes it hard to fit into a flat spreadsheet. The conversion collapses the tree into rows and columns.
How is the "row element" chosen?
Every XML to CSV conversion has to pick a "row element" — the element whose repeated instances become the rows of the CSV. The converter auto-detects this by looking for the most common direct child of the root element. In the example above, <book> is the obvious choice because <catalog> has two <book> children.
Sometimes the choice isn't obvious. An RSS feed has a single <channel> with many <item> children — the items are the rows. A SOAP response may have a single root with nested arrays — the deepest repeating element is usually the row. If auto-detect picks the wrong element, override it in the settings.
Common row element names to expect: item, entry, row, record, product, order, customer, user. If your XML uses something obscure, just type the element name in settings.
How are attributes handled?
XML attributes are key-value pairs on the opening tag of an element, like <book id="1"> where id is the attribute. They are first-class in XML and often carry the most important identifiers (IDs, types, references).
By default, HopConvert includes attributes as columns prefixed with @. The example above becomes:
@id,title,author,year,price
1,The Pragmatic Programmer,Andy Hunt,1999,42.50
2,Clean Code,Robert Martin,2008,38.00
The @ prefix makes attributes visually distinct from child elements, especially when an attribute and a child element share the same name (which is legal in XML). You can change the prefix to anything you like in settings, or disable attribute inclusion entirely.
How are nested elements flattened?
When a row element contains nested children, those become columns. By default, nesting is flattened with a separator — <address><city>NYC</city></address> becomes the column address__city. The separator is configurable (__, ., /, etc.).
For deeper nesting, the rule applies recursively: <author><name><first>Andy</first><last>Hunt</last></name></author> becomes author__name__first and author__name__last. If a column name gets unwieldy, you can also use a "concatenate" strategy that joins all leaf values into a single column per row.
What about XML namespaces?
Namespaces are XML's way of avoiding element name collisions — <ns:title> and <atom:title> can coexist in the same document. By default, the converter strips namespace prefixes for cleaner column names (title instead of ns:title). If you need the prefix preserved, enable it in settings.
SOAP responses are heavily namespaced (<soap:Envelope>, <soap:Body>, etc.). The converter handles them without special configuration — the prefixes are stripped, and the underlying element names become the column names.
Common XML formats
These formats all work out of the box with HopConvert's auto-detect:
- RSS 2.0:
<rss><channel><item>...</item></channel></rss>— row element isitem, columns includetitle,link,description,pubDate. - Atom 1.0:
<feed><entry>...</entry></feed>— row element isentry, columns includetitle,updated,summary,author/name. - SOAP responses:
<soap:Envelope><soap:Body><GetProductsResponse><Product>...</Product></GetProductsResponse></soap:Body></soap:Envelope>— the deepest repeating element is auto-detected as the row. - Sitemaps:
<urlset><url>...</url></urlset>— row element isurl, columns includeloc,lastmod,changefreq,priority. - SVG:
<svg><path>...</path></svg>— useful for extracting geometry data from vector graphics. - KML (geographic):
<kml><Placemark>...</Placemark></kml>— row element isPlacemark, columns includename,description, andPoint/coordinates.
Common edge cases
Real-world XML is rarely as tidy as the textbook example. Here are the most common gotchas and how the converter handles them:
- Mixed content (text + child elements):
<p>Hello <em>world</em>!</p>— the text is concatenated and the child element is added as a separate column. - Repeated children with the same name:
<person><phone>555-1234</phone><phone>555-5678</phone></person>— joined with a delimiter (default|) into a singlephonecolumn. - Empty elements:
<description></description>— output as an empty cell. - Self-closing tags:
<br/>— output as an empty cell or, if attributes are present, an@attrcolumn. - CDATA sections:
<![CDATA[<raw html>]]>— the raw content is preserved as the cell value, with the angle brackets escaped for CSV. - XML declaration and DOCTYPE: Stripped before parsing. The
<?xml ?>header and any<!DOCTYPE>declarations are removed automatically. - Namespaces in tags:
<ns:title xmlns:ns="...">— the prefix is stripped (or preserved, per settings) and the local name is used as the column header. - Comments and processing instructions: Stripped before parsing. Comments (
<!-- -->) and processing instructions (<? ?>) are ignored.
Frequently asked questions
Everything you need to know about converting XML to CSV with HopConvert.
What is an XML to CSV converter?
Which XML element becomes the row?
How are attributes handled?
What about nested elements?
Does the converter work with RSS and Atom feeds?
What about SOAP or API responses?
Is my XML data private?
What's the maximum file size?
Can I open the CSV in Excel or Google Sheets?
Does the converter preserve XML namespaces?
Convert your XML now
Free, fast, and private. No sign-up. Your data never leaves your browser.