Free XML flattener — upload or paste — no server

Convert XML to CSV
Flatten any XML
structure.

Free XML to CSV converter. Auto-detects row elements, flattens nested XML with dot notation, handles attributes and namespaces. Upload an XML file or paste directly. Runs entirely in your browser.

Your data never leaves your browser
Auto row detection
Nested XML flattening
Upload or paste XML
Always free
XML to CSV Converter  100% client-side
Drop your XML file here
.xml, .rss, .atom, .kml, .gpx — row elements auto-detected
or paste XML directly
 Conversion complete

      
How XML to CSV conversion works

Auto-detection, flattening and serialization — three steps under the hood.

1
Auto-detect row elements

CSVShift uses the browser's native DOMParser to parse the XML and then finds the most-repeated child element — the element that will become rows in the CSV. For <products><product>…</product></products>, it detects <product> automatically.

2
Flatten nested elements

Each row element is recursively flattened. Nested elements become dot-notation column names — <address><city> becomes the column address.city. XML attributes become @attribute columns. Array elements with the same tag get indexed: tag[0], tag[1].

3
Build column union and download

The column set is built as the union of all keys across all rows — so records with optional fields produce empty cells rather than errors. The resulting CSV is RFC 4180 compliant and ready for Excel, Google Sheets or any database import tool.

Flattening example

How nested XML becomes flat CSV columns.

<products>
  <product id="1">
    <name>Widget Pro</name>
    <price currency="USD">9.99</price>
    <address>
      <city>New York</city>
      <country>US</country>
    </address>
  </product>
</products>
↓ CSVShift flattens to ↓
@id name price.@currency price address.city address.country
1 Widget Pro USD 9.99 New York US
Why is XML to CSV conversion challenging?

The structural mismatch between XML and CSV — and how CSVShift handles it.

XML is hierarchical — it supports nested elements, attributes, mixed content (text + child elements) and namespaces. CSV is flat — every row has the same columns, all values are plain strings. Converting between them requires decisions about how to handle depth, attributes and repeated elements.

The trickiest case is repeated child elements with the same tag — for example a product with multiple <image> elements. CSVShift indexes these as image[0], image[1] etc. so all data is preserved in the flat output without losing any records.

When do you need to convert XML to CSV?

Common real-world situations where flattening XML data is necessary.

RSS and Atom feeds

News aggregators, content tools and SEO platforms export article lists as RSS or Atom XML. Converting to CSV lets you analyse publication dates, titles and URLs in a spreadsheet or import them into a database for tracking.

SOAP API responses

Legacy enterprise APIs return XML responses. Copying the XML from a SOAP response and pasting into CSVShift converts it to a CSV table — avoiding the need to write an XSLT transformation or a custom parser.

Product feed analysis

Google Shopping, Amazon and affiliate networks export product catalogs as XML feeds. Converting to CSV lets you audit prices, stock levels and descriptions in Excel — essential for feed optimization and competitive analysis.

KML and GPX geodata

Geographic data in KML (Google Earth) and GPX (GPS) formats is XML-based. Converting to CSV extracts coordinates, names and metadata into a spreadsheet or a format ready for GIS tools and mapping applications.

Converter options explained

What each setting does and when to change it.

OptionValuesWhen to use it
Flatten depth 2 · 5 · 10 · Unlimited 5 levels handles most real-world XML without producing too many columns. Use 2 for shallow XML where deep nesting should stay as a JSON string. Use Unlimited for deeply hierarchical data where every field must be a separate column.
XML attributes Include · Ignore Include adds attribute values as columns prefixed with @ — e.g. an id attribute becomes @id. Ignore drops all attributes — use when you only need text content and attributes are metadata you do not need in the CSV.
Namespaces Strip · Keep Strip removes namespace prefixes from element names — g:price becomes price. Recommended for most XML. Keep preserves prefixes — needed when two elements with the same local name but different namespaces must be distinguished.
Related CSV tools

Other free converters on CSVShift you might need.

Popular searches
xml to csv converter convert xml to csv online convert xml to csv free xml to csv converter free transform xml to csv xml to csv conversion tool convert xml file to csv change xml to csv translate xml to csv xml to csv python alternative rss xml to csv xml product feed to csv how to convert xml to csv

XML parsed natively
in your browser. Always.

CSVShift uses the browser's built-in DOMParser API — the same engine that renders web pages — to parse your XML. No external library is loaded. Your XML file is never transmitted to any server. Paste or upload, and the entire flattening and serialization happens locally in JavaScript.

DOMParser is a W3C standard, available in every modern browser, and handles malformed XML gracefully — reporting parse errors clearly rather than producing silently incorrect output.

Browser-native DOMParser
No external XML library loaded. Uses the same engine that renders web pages — fast and standards-compliant.
Auto row detection
Identifies the most-repeated child element as rows automatically — no manual selector required for standard XML.
Paste XML directly
No file required — paste a SOAP response, API output or XML snippet directly into the text area.
Free, no conditions
No file size limit, no watermark, no account. Funded by display advertising only.
Frequently asked questions
Common questions about converting XML files to CSV format.
How do I convert XML to CSV?
Upload your XML file or paste XML into the text area. CSVShift auto-detects the row element, flattens nested elements with dot notation, handles attributes and downloads a CSV. No configuration needed for standard XML files.
How does CSVShift detect which XML elements become rows?
The tool looks for the most-repeated child element under the document root or one level deeper. In <products><product>…</product></products> it detects <product> as the row element. The detected element is shown in the hint above the converter before you click Convert.
How are nested XML elements handled?
Nested elements are flattened using dot notation. <address><city>Paris</city></address> becomes the column address.city. Repeated elements with the same tag name are indexed: image[0], image[1]. Set the flatten depth to control how many levels are expanded.
How do I convert XML to CSV in Python?
Using pandas (simplest): import pandas as pd; df = pd.read_xml('file.xml'); df.to_csv('out.csv', index=False). Using xml.etree: parse the tree, iterate over repeating elements, extract text content and write rows with csv.writer. For a no-code browser solution with visual preview, use CSVShift.
Is my data safe when converting XML online?
Yes. CSVShift parses XML using the browser's native DOMParser — no external library loaded, no server involved. Your XML data is never transmitted. Open the Network inspector during conversion and you will see zero outbound data requests.