Convert XML to CSV
Drop an .xml file below or paste the XML and download a CSV. Fileshape finds the element that repeats (each <product>, <order> or <row>), makes one row per element, turns child elements and attributes into columns, and flattens nested elements into dotted names. It runs in your browser; choose Excel or JSON instead if you prefer.
Drop a file to convert
CSV, Excel, JSON, XML and more. It stays on your device; nothing is uploaded.
How the rows are found
XML exports wrap their data in layers, such as <catalog><products><product>…</product></products></catalog>, often with header elements alongside. Fileshape looks through the document for the longest list of repeating elements and uses each one as a row, so you don't need to know the structure or write XPath. A document with a single record becomes a one-row table.
Child elements, attributes and nesting
Each child element becomes a column named after its tag: <product><sku>00123</sku><price>24.50</price></product> gives the columns sku and price. Attributes are kept too, as columns that start with @, so <product id="7"> adds an @id column. Nested elements are flattened into dotted names (shipping.city), and values are kept as text, so codes keep their leading zeros.
Different records don't need the same children. The columns are the union of every element and attribute seen, and missing values are left empty. In the mapping step you can rename columns, drop the ones you don't need, or reorder them for the system you're importing into.
Going the other way: CSV to XML
The converter also writes XML. Choose XML as the output and each row becomes a <row> element inside a <rows> root, with one child element per column; you can change both names in step 4. Column names that aren't valid XML tag names, such as ones with spaces or starting with a digit, are adjusted to valid names automatically.
Ask AI about this file
Ask ChatGPT, Claude or Cursor about your file. Fileshape cleans it, masks personal columns and gives your AI one link, so totals come from every row.
FAQ
Questions
How do I convert XML to CSV?
Drop the XML file into the converter on this page. The repeating records are detected automatically; check the columns and download CSV.
Are XML attributes converted?
Yes. Each attribute becomes its own column, prefixed with @ (for example @id).
Can I convert XML to Excel instead?
Yes. Choose Excel (.xlsx) as the output format in step 4.
Is the XML uploaded?
No. Parsing and conversion run in your browser.
Related
Other conversions
- Convert Excel to CSV without breaking your dataConvert an Excel workbook to clean CSV in your browser: pick the sheet, skip title rows, keep leading zeros and choose comma or semicolon delimiters.
- Convert JSON to CSV, including nested JSONConvert JSON or JSON Lines to CSV in the browser. Nested objects become dot-named columns, arrays are joined, and the record list is found automatically.
- Convert CSV to JSONTurn CSV into a JSON array of objects, nested JSON via dot-named columns, or JSON Lines. Delimiters and quoted fields detected automatically.
- Convert CSV to Excel (XLSX) without losing leading zerosConvert a CSV to an Excel .xlsx file in your browser. Leading zeros and long IDs stay intact, numbers stay numbers, and the delimiter is detected for you.
Updated 2026-11-27