Skip to content
cliplimeClipLime

Convert XML to CSV

Paste XML or drop a file and get a CSV your spreadsheet opens, with one row per repeated record.

Runs on your device, nothing is uploaded

Convert from

to

Paste, type, drop a file here or load one.

0 characters, 0 lines

Options

When off, columns are called column1, column2 and so on.

Nested objects become columns such as address.city. Off keeps them as JSON text in one cell.

XML attributes

How attributes are named next to child elements.

More options

A path such as data.items. Use a single dot to turn the whole value into one row.

The dot in address.city.

ns:name becomes name.

Helps Excel show accents and symbols correctly.

Puts an apostrophe before text that starts with = + - or @.

At a glance

Input
XML with repeated records: RSS and Atom feeds, sitemaps, product feeds and exports from other software.
Rows
The repeated element becomes the rows. The converter finds it, also inside wrappers such as rss and channel, and says which one it used. You can type a path instead.
Columns
Child elements and attributes become columns. Nested elements get dotted names such as author.first, and attributes start with @ unless you choose plain names.
Repeats
A tag that repeats inside a record becomes genre.0, genre.1, or one cell such as g1;g2 if you choose to join them.
Spreadsheets
Pick the delimiter, add a byte order mark so Excel shows accents, quote every value, or protect against formulas.
Left out
Anything outside the rows, such as a feed's own title, is not in the table. A note names it.
Privacy
Your XML is converted in your browser tab and never uploaded.

How to do it

  1. 1

    Add your XML

    Paste it, drop a file on the input box, or press Load a file. Example fills in a small team file with attributes and a repeated element.

  2. 2

    Check the rows

    A note under the result says which element became the rows. To use a different one, open More options and type its path under Rows come from.

  3. 3

    Choose the columns

    Decide whether nested elements are spread into columns, how repeated tags are written, and whether attribute columns keep the @.

  4. 4

    Set the delimiter and save

    Choose the delimiter under Options, then press Copy or Download to save a .csv file.

Choosing what a row is

A table needs one row per record, but XML does not say which element is the record. The converter decides in this order:

  • The document element is skipped. <catalog> or <urlset> is the container, not a record.
  • Its repeated child is the row: <url> for a sitemap, <book> for a catalog.
  • If the rows sit deeper, it looks inside the single wrapper. <rss><channel> is passed to reach the repeated <item>, and <response><data><items><item> works the same way.
  • If there is only one record, you get one row.

A note names the element it picked and lists what it left out. For an RSS feed it says that channel.title and channel.link are not in the table, because the title belongs to the feed, not to an item. If the choice is wrong, open More options and type a path under Rows come from, for example channel.item or data.row. A single dot makes the whole document one row.

Attributes, nested tags and repeats

Each child element and each attribute becomes a column. <book id="b1"><title>A</title></book> gives the columns @id and title. The @ keeps an attribute apart from a child element of the same name. Choose name under XML attributes to drop it.

Nested elements are joined with a dot: <author><first>X</first><last>Y</last></author> gives author.first and author.last. An attribute on a nested element gives names such as link.@href, as in Atom feeds.

A tag that repeats inside a record, such as two <genre> elements, becomes genre.0 and genre.1. Under Lists inside a record you can join them into one cell, g1;g2, or keep them as JSON text. XML cannot tell a list of one from a single value, so when a tag repeats in some records but appears once in others, it is written as a list in every row, and a note says so. That keeps the columns lined up.

Records can have different tags. The columns are all the names found, in order of first appearance, and a record without one gets an empty cell.

Opening the result in a spreadsheet

  • Delimiter. Excel uses the list separator of the computer's regional settings, a semicolon in many European countries. If everything lands in one column, choose a semicolon under Delimiter in the output.
  • Accents. Feeds are full of accents and symbols. Turn on Add a byte order mark under More options so Excel reads the file as UTF-8.
  • Formulas. Excel runs cells that start with = + - or @ as formulas. Turn on Protect against spreadsheet formulas if the XML comes from people you do not know.

What a table cannot hold

  • One kind of record at a time. If the XML holds customers and orders, one table is made from the list that repeats most. Type the other path under Rows come from and convert again.
  • Mixed content. Text between tags is merged into one value and loses its position.
  • Comments, processing instructions and the DOCTYPE are dropped.
  • Namespaces. Prefixes stay in the column names, as in ns:price, unless you turn on Remove namespace prefixes under More options.

Questions people ask

How do I turn an RSS feed or a sitemap into CSV?

Paste the XML or load the file. A sitemap gives one row per url element, with columns such as loc and lastmod. An RSS feed gives one row per item, and the feed's own title and link are left out, which a note under the result says.

Why do my columns start with @?

Those columns come from XML attributes. The @ keeps them apart from child elements of the same name. Choose name under XML attributes and the @ is dropped.

My XML has several kinds of records. Which one is used?

The list that repeats most at the first level that has one, and a note says which. To convert another kind, open More options, type its path under Rows come from, for example orders.order, and convert again.

Why are there columns like genre.0 and genre.1?

The record has the genre tag more than once. Each one gets its own column so nothing is lost. Under Lists inside a record you can join them into one cell instead, or keep them as JSON text.

Can it handle a large XML file?

It depends on the memory of your device. In our tests on a recent computer, an XML file with 50,000 records (8 MB) became CSV in about a second, and 200,000 records (32 MB) in about four seconds. The conversion runs in the tab itself, so the page can pause while it works. Phones and older computers will manage less.

Is my XML uploaded?

No. The text or file is read and converted in your browser tab, so private data stays on your device.