Skip to content
Free · Runs in your browser

XML to CSV converter

Turn an XML file into a CSV. Repeated elements become rows, and your file never leaves your browser.

Works with
XMLCSVXLSX
Opens inExcelGoogle Sheets

Drop an XML file here

Any XML file, up to 100 MB. It stays on your computer.

  • No sign-up
  • Nothing uploaded
  • Comma, semicolon or tab
  • Arla Foods logo
  • Bacardi logo
  • British American Tobacco logo
  • Everest Detection logo
  • Golden Acre logo
  • Handlangers logo
  • Inspired Learning Group logo
  • Kantar logo
  • MUFG logo
  • NielsenIQ logo
  • PTI Digital logo
  • RethinkFirst logo
  • Starbucks logo
  • The Specialist Works logo
What you get

A CSV from your XML, made on your computer.

  • Your file stays on your computer

    The CSV is written in your browser. Nothing is sent to Mammoth or anyone else.

  • Nested elements become columns

    An element like name inside customer gets its own column, customer.name.

  • Commas stay inside their cell

    A value like web, repeat is quoted, so it doesn't split into two columns.

How it works

How to convert XML to CSV

The converter finds the element that repeats, writes one line for each, and gives every child element and attribute a column.

  1. 1

    Add your XML

    Drop an .xml file on the box, choose one, or paste the XML in.

  2. 2

    Check the rows

    A preview shows the columns and the first rows of your CSV.

  3. 3

    Download

    Pick a separator and save the CSV, or take an Excel file instead.

Your options

Other ways to do it

If you write code, pandas can read XML too, one level at a time.

  • Python with pandas

    Flat XML in a script

    • Finds the repeating rows for youPartly
    • Flattens nested elementsNo
    • No code or installNo
    • Runs on a scheduleYes
  • Copy and paste

    A few short records

    • Finds the repeating rows for youNo
    • Flattens nested elementsNo
    • No code or installYes
    • Runs on a scheduleNo
  • This page

    This converter

    Nested files, no setup

    • Finds the repeating rows for youYes
    • Flattens nested elementsYes
    • No code or installYes
    • Runs on a scheduleNo
With code

How to convert XML to CSV in Python

pandas reads XML in one line. It reads a single level, so nested elements need their own path or this converter.

Want it in Excel instead? Excel can import XML with Power Query. The steps are on the XML to Excel page.

Python
import pandas as pd

pd.read_xml("orders.xml", xpath="//order").to_csv("orders.csv", index=False)

Needs the lxml package. A nested element like customer comes back as an empty column.

orders.csv
id,customer,total,paid
1041,,129.5,True
1042,,48.0,False

Your file stays private

The converter runs inside this page. Your XML is read and written out as CSV on your computer, and nothing is sent to Mammoth. That makes it safe for exports with customer or bank data in them.

How we handle your data

Once the page has loaded, it works with your internet switched off.

Every month

Getting the same XML export every month?

Mammoth can take it from there. Put the converted CSV files in a folder and their rows are added to one table automatically.

Try Mammoth free

Bank exports

Septemberbank-sep.csv
Octoberbank-oct.csv
Novemberbank-nov.csv
DriveDropboxOneDriveSFTP
All transactionsUp to date
Sep 02Card payment64.20
Sep 15Transfer in2,400.00
Oct 03Direct debit118.00
Nov 01Card payment39.90
Nov 06Transfer out750.00

Illustration. Every new file in the folder is added to the same table.

Questions

XML to CSV questions

Is my XML sent anywhere?
No. The page reads your file and writes the CSV inside your browser. Once the page has loaded, it works with your internet switched off.
Is XML a CSV?
No. XML nests data inside tags, often several levels deep. CSV is one flat table of rows and columns. Converting means choosing which element is a row and flattening the rest into columns, which this page does for you.
Which part of my XML becomes the rows?
The element that repeats most, such as each order inside an orders element. The table tells you which element it used.
What happens to attributes and nested elements?
Both become columns. Nested elements get dotted names, like customer.name. An element that repeats inside a row shares one cell, separated by commas and quoted.
Why does my CSV open as one column in Excel?
Your copy of Excel expects semicolons, which is common where a comma is the decimal mark. Convert again with the separator set to Semicolon.
Can I get an Excel file instead?
Yes. After converting, choose Excel file. The XML to Excel page does the same with Excel first.
Is it free?
Yes, with no account and no email.