XML ⇄ CSV Converter
Convert a list of XML records into a CSV table, or CSV rows into a simple XML document. Handles files up to 200MB.
Or convert a file directly — supports files up to 200MB
Drag & drop a file here, or click to browse
Processed in the background, so the page stays responsive even for huge files
How to use this tool
For XML → CSV, paste XML that contains a repeating list of records (like <record> elements) — the tool automatically finds that list and flattens nested fields into dotted column names. For CSV → XML, each row becomes a <record> element wrapped in a <root> tag. Everything is processed locally in your browser.
Worked example: attributes become columns
A two-product catalogue, with XML → CSV selected:
<catalog>
<product id="p1">
<name>Desk Lamp</name>
<price currency="INR">1499</price>
<sku>00731</sku>
</product>
<product id="p2">
<name>Chair</name>
<price currency="INR">4999</price>
<sku>00732</sku>
</product>
</catalog>name,price.#text,price.@_currency,sku,@_id Desk Lamp,1499,INR,00731,p1 Chair,4999,INR,00732,p2
Each <product> is a row. The id attribute becomes an @_id column, and <price>, which has both a value and an attribute, splits into price.#text and price.@_currency. The SKUs keep their leading zeros in the CSV text, but a spreadsheet opening the file directly will drop them, so import that column as text or use the XML ⇄ Excel converter instead.
One record isn't a list
The converter looks for an element that repeats and makes one row per occurrence. The same catalogue with only the first product has nothing that repeats, so instead of a one-row CSV you get Could not find a repeating list of records in this XML to convert to rows. For a single record like that, the XML ⇄ JSON converter shows the whole structure.
When a field repeats in some records but not others
XML can't mark "a list with one item", and that shows up in the columns. Asha has two <tag> elements and Ravi has one:
<customers> <customer><name>Asha</name><tag>gst</tag><tag>annual</tag></customer> <customer><name>Ravi</name><tag>gst</tag></customer> </customers>
name,tag.0,tag.1,tag Asha,gst,annual, Ravi,,,gst
Asha's two tags are numbered tag.0 and tag.1, but Ravi's single tag lands in a separate tag column, so the same field is split across columns. Before filtering or counting tags in a spreadsheet, move the values in tag into tag.0.
CSV → XML: headers become element names
Each row becomes a <record> inside <root>, and each header becomes an element name. XML names can't contain spaces or start with a digit, so the CSV First Name,2026 Sales,city / Asha,1499,Pune gives <First_Name>Asha</First_Name>, <_2026_Sales>1499</_2026_Sales> and <city>Pune</city>. Rename the headers first if the receiving system expects particular element names.
Frequently Asked Questions
How does the tool find the "list of records" inside my XML?
It looks for a repeated child element under a common parent — like multiple <record> elements inside a <records> wrapper — and treats each repeated element as one row. If your XML doesn't have an obviously repeating structure (a single deeply nested document rather than a list of similar records), CSV's flat row-and-column shape won't map onto it well regardless of which tool you use, since CSV has no way to represent arbitrary nesting.
What happens to nested fields inside each record when converting to CSV?
Nested elements are flattened into dotted column names — a <record><address><city>Austin</city></address></record> becomes a column named address.city. This keeps every value in the row-and-column format CSV requires, at the cost of losing the visual nesting XML provides.
Does CSV → XML recreate the exact structure my original XML had?
Not necessarily — going CSV → XML builds a fresh, generic structure (each row as a <record> inside a <root>) rather than reconstructing whatever custom element and attribute names your original XML used, since a flat CSV file has no way to specify those names. If you need the output to match a specific existing XML schema, expect to rename elements afterward.
Related Tools
Related Blog Posts
Converting CSV and XML to Excel Without Losing Data
Why double-clicking a CSV mangles PIN codes, long IDs and ₹ signs, what a careful CSV-to-Excel conversion does instead, and how XML records map to spreadsheet columns.
Read moreHow to Convert JSON to Excel, CSV, XML and YAML (and Back)
What actually happens to your data when JSON becomes a spreadsheet, XML, or YAML: missing keys, nested values, leading zeros, and the XML array problem, with real converter output.
Read moreHow to Flatten Nested JSON and Convert JSONL Files
How dot-notation flattening turns nested objects and arrays into spreadsheet columns, what survives the trip back, and how JSON Lines differs from a normal JSON file.
Read more