XML to CSV Converter
Convert XML to CSV format as you type
XML Input
CSV Output
Paste your XML on the left and the CSV shows up here.
Or drop a file on this box, , or .
What is XML to CSV Converter?
Need an XML export in a spreadsheet? Paste it here and you get CSV back. The converter looks for the repeated element that holds your records (every <subscriber> inside <subscribers>, say) and writes one row per record. A document with a single record becomes a single row.
Each record is flattened into columns. Child elements keep their name (plan), nested ones get a dotted path (address.city), and attributes get an @: @id for the record's own attributes and device@type for nested ones. If an element repeats inside a record, plain values are joined with ; in one cell, and repeated groups get numbered columns such as line.1.sku and line.2.sku. The result opens in Excel, Google Sheets or any data tool.
Values that contain commas, quotes, line breaks or leading spaces are quoted the CSV way, with inner quotes doubled; that is why the sample's third subscriber comes out as "Business Plus, 2 lines". Elements outside the records, such as a feed title next to the entries, are not included. Your browser does the flattening itself, and the export stays on your computer.
How to Use XML to CSV
Three steps, and you press nothing for the middle one: the CSV pane redraws while you edit the XML.
Paste, Upload, or Load Sample
Paste XML into the XML Input panel on the left, or click Upload to read a file from disk. Sample fills the editor with three phone subscribers, the last one without a device. A cut-down version:
<subscribers><subscriber id="SUB-1001"><plan>Unlimited 5G</plan><device type="smartphone"><model>Pixel 8</model></device></subscriber></subscribers> Use Clear to start fresh. The example above has a single subscriber, so it becomes one row with the columns @id, plan, device@type and device.model.
View CSV Output
The CSV lands in the right CSV Output panel while you are still typing. Columns are gathered across all the records, not just the first one, and each sits where it was first seen; a record without that field simply gets a blank cell. Malformed XML shows the parser's error in place of the CSV.
Download or Copy
Click Download to save converted.csv, or Copy to paste it straight into a spreadsheet.
When You'd Actually Use This
Data Analysis
Open a carrier or billing export in a spreadsheet, then sort by dataUsageGb or filter the @status column to find every suspended line in seconds.
Database Import
Import XML data into databases that accept CSV. Many databases and data tools work better with CSV format for bulk imports.
Reporting
Convert XML reports to CSV for easier sharing and presentation. CSV files are universally supported and easy to open in spreadsheet applications.
Data Migration
Migrate XML data to systems that prefer CSV format. Great for moving data between different platforms or tools.
Common Questions
Is my XML uploaded?
No. DOMParser reads the XML inside this page and the rows are assembled there as well; no request goes out with your data. The only limit is size: past 5 MB the page asks you to split the file.
How does it decide what a row is?
It walks down from the root and picks the first repeated element that has children or attributes, so <orders><order/><order/></orders> gives one row per order. If nothing repeats, the whole document (or the single record inside a wrapper) is one row.
How are attributes converted?
Each attribute gets its own column with an @: @id for an attribute on the record, price@currency for one on a nested element. Namespace declarations are skipped.
How are nested elements handled?
They are flattened into dotted column names, like address.city. Repeated plain values in one record are joined with ; , and repeated nested groups get numbered columns (line.1.sku, line.2.sku), so nothing ends up as a JSON blob in a cell.
Are values typed or reformatted?
No. Every value is copied as the text in the XML, so 02134 stays 02134 in the file. Excel may still reformat it when it opens the CSV; import it as text if that matters.
Does it work with large datasets?
Up to 5 MB of XML. Bigger files are refused to keep the page responsive; split them first or use a streaming tool such as XMLStarlet.
Other XML Tools You Might Need
XML that refuses to convert usually has a structural problem, so format or validate it first. If the data is headed for an API or a config file rather than a spreadsheet, the JSON and YAML converters take the same input: