Utilo

XML to CSV Converter – Free, Online, Private

Find a repeated XML element and write one CSV row per element. Child text becomes columns.

Input
Output

How to convert XML to CSV

  1. Paste XML whose repeating records are siblings, such as a list of user elements.
  2. The first array of elements becomes the table.
  3. Copy the CSV. Attributes are not columns unless you move them into child elements.

Which elements become rows

The document is parsed to JSON with the same rules as the XML to JSON page, then the first array of objects is treated as the row set. In the sample, user repeats, so each user is a row and name and city are columns. A document with several lists uses the first list found in object key order. If the shape is wrong, wrap the records you care about so they are the repeated tag, or convert to JSON first and delete the other arrays. Text-only children become cell values. A nested element becomes a JSON string in the cell, same as the JSON to CSV page.

Attributes

Attributes are stored as @name in the JSON step. They can show up as columns named @id. If you would rather have a plain id column, convert to JSON, rename the key, and use JSON to CSV. Numeric text is coerced before it hits the CSV writer, so a numeric element becomes an unquoted number. Leading zeros in element text can disappear for the same reason. Put the value in an attribute if you need the characters preserved, then rename.

Worked example

Two user elements produce a header name,city and two rows, Ada in London and Grace in New York. There is no id column because id was not in this sample. Add id as a child element if you want it as an ordinary column. A missing city on one user yields an empty cell. The CSV quoting rules match the other CSV tools on this site, so a city that contained a comma would be quoted.

Feeds and invoices

A simple export is a good fit. An invoice with header fields plus a line-item list will grab whichever array appears first, which might be the line items and might not. Look at the header row before you trust it. Nothing is uploaded. A partner file can be flattened on a laptop that is not supposed to send the file to a conversion site.

Frequently asked questions

How are rows chosen?

The first repeated element that becomes a JSON array of objects is the table. Other lists are ignored.

Can I keep attributes?

They appear as columns prefixed with @. Rename them in JSON if you want different headers.

What about namespaces?

The prefix stays in the element name, so the column might be called name or ns:name depending on the tag.

Is the XML uploaded?

No. Parsing is local.