Loona Automation logoLoona Developer Tools
Home › Data Converters

XML to CSV Converter

In short: turn record-style XML into a spreadsheet-ready CSV: each repeated child of the root becomes a row, and their fields and attributes become the columns.
🔒 Private by design: everything runs in your browser on this device. Your input is never uploaded to a server.

Example

Input:

<users><user id="1"><name>Ali</name><age>30</age></user><user id="2"><name>Sara</name><age>25</age></user></users>

Output:

name,age,@id
Ali,30,1
Sara,25,2

About this converter

Most XML-to-CSV jobs are really "records trapped in angle brackets": a root element containing many similar record elements. This converter takes the root's children as rows, collects every field name and attribute (as @attribute) across all records as the columns, and leaves cells empty where a record lacks a field — the union-of-columns approach that matches how the data will actually be used in Excel or a database import. Nested grandchildren are serialised as JSON text in their cell rather than silently dropped. If your XML root has only one record, wrap it or the converter will (fairly) complain there are no rows.

Frequently Asked Questions

What if records have different fields?

The CSV gets the union of all fields; records missing a field get an empty cell. That is the safest table shape for ragged real-world data.

Can it convert huge XML files?

It runs in your browser's memory, so multi-hundred-megabyte files will struggle; for those, a streaming desktop tool is the right choice.

Related Developer Tools

Embed this tool on your website — free

Add this tool to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the tool to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.