ToolFeather
Developer / SEORuns in your browser

XML to CSV Converter

Flatten XML into rows and columns: the repeated record element becomes the rows, nested elements and attributes become dotted columns, and the result opens cleanly in Excel or Google Sheets.

Quick presets

XML to CSV Converter

XML
CSV

Table preview –

Runs in your browser — nothing you enter is uploaded or stored.

ToolFeather · XML → CSV
Scratchpad auto-saved
Stored in this browser (localStorage)
Step-by-step~40s read

How it works — in four simple steps

No signup and nothing to install — it all runs in your browser.

1

Add your XML

Paste it into the left box, press Open file, or drag a .xml file onto it. Sample loads a realistic example.

2

Set the options

Adjust the options above the boxes — the output updates instantly as you change them.

3

Check the result

Read the status line: it reports rows, keys and any value that couldn't be represented in CSV.

4

Copy or download

Copy the CSV or download it as a .csv file. Nothing was uploaded at any point.

Pro tip

Opening in Excel on Windows? Tick UTF-8 BOM so accents and symbols display correctly.

Features

Attributes kept, clearly marked

XML attributes become keys with an @ prefix (or _ / - / none), so they never collide with child elements of the same name.

Real types, not just strings

Numbers, booleans and empty values are detected — while codes with leading zeros such as 00742 or +44 phone numbers stay text.

Namespace control

Keep prefixes like dc:title, or strip them to get plain keys when the namespaces don't matter to you.

Stable array shape

Optionally make every child element an array, so code doesn't break when a list happens to have only one entry.

Nested data flattened

Nested objects become dotted columns (address.city), and arrays of plain values are joined so every row fits the grid.

Any output delimiter

Comma for most tools, semicolon for European Excel, tab or pipe when your data is full of commas.

Private by design

Parsing and conversion run in your browser with JavaScript — your data is never uploaded, logged or stored.

About the XML to CSV Converter

To turn XML into a table, a converter needs to find the records — the element that repeats. In a product feed it's <product>, in a sitemap <url>, in an RSS feed <item>. This tool parses the XML into a tree and walks down from the root until it reaches the first list of repeated elements; those become the rows. If there's no repetition at all, the whole document becomes a single row.

Each record is then flattened. Child elements become columns, nested elements become dotted column names (address.city), and attributes become columns with the attribute prefix (@id), so nothing is lost. When a record contains a list of plain values — several <author> elements, say — they are joined into one cell with semicolons; a list of complex elements is kept as JSON text in its cell. Columns are the union of all records, so a field that appears in only some records still gets a column.

The CSV is written to RFC 4180: fields containing the delimiter, quotes or line breaks are quoted and inner quotes doubled. For Excel on Windows, tick UTF-8 BOM so accented characters display correctly, and choose semicolons if your Excel uses a comma as the decimal separator.

Examples

A sitemap.xml is a list of repeated <url> elements — exactly the shape that becomes a clean table.

XML input
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://toolfeather.com/</loc>
    <lastmod>2026-10-20</lastmod>
    <priority>1.0</priority>
  </url>
  <url>
    <loc>https://toolfeather.com/tools/xml-to-csv/</loc>
    <lastmod>2026-10-21</lastmod>
    <priority>0.8</priority>
  </url>
  <url>
    <loc>https://toolfeather.com/blog/</loc>
    <lastmod>2026-10-18</lastmod>
  </url>
</urlset>
CSV output
loc,lastmod,priority
https://toolfeather.com/,2026-10-20,1
https://toolfeather.com/tools/xml-to-csv/,2026-10-21,0.8
https://toolfeather.com/blog/,2026-10-18,

This output was produced by the converter on this page with the default options — load it with the “Sitemap” preset above and change any option to see the effect.

How XML maps to CSV

In XMLBecomes in CSV
Repeated element, e.g. <book> ×NN rows
Child <title>column title
Attribute isbn="…"column @isbn
Nested <address><city>column address.city
Several <author> valuesone cell: Kernighan; Ritchie
Text plus attribute <price cur="USD">45</price>columns price.@cur and price.#text
Element missing in some recordsempty cell in those rows

Things that trip people up

XML vs CSV at a glance

PropertyXMLCSV
SpecificationXML 1.0 Fifth Edition (W3C, 2008)RFC 4180 (2005)
File extension.xml.csv
Media typeapplication/xml (RFC 7303)text/csv
Data typestext only (types come from a schema)text only — every cell is a string
CommentsYes <!-- -->No
NestingUnlimitedNone (flat rows)

Frequently asked questions

5 answers
How does it decide which XML elements become rows?
It looks for the first element that repeats (two or more siblings with the same name) as it walks down from the root; each of those elements becomes one CSV row.
What happens to XML attributes?
They become their own columns, prefixed with @ by default, e.g. @id. You can change or remove the prefix.
Can I open the result in Excel?
Yes. Download the .csv and open it; tick UTF-8 BOM first so non-English characters display correctly, and pick semicolons if your Excel expects them.
Can it convert a Google Merchant or sitemap XML file?
Yes — both are lists of repeated elements (<item> or <url>). Strip namespace prefixes to get clean column names like price instead of g:price.
Is my data uploaded anywhere?
No. The XML is parsed and converted by JavaScript in your browser tab; nothing is sent to a server, so it is safe for internal exports, customer lists and configuration files with secrets.