araç köşesi

XML to CSV

Turn XML records into a CSV table; the repeating tag becomes the row automatically

Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.

How it works

A common case: your store platform or a supplier sends the product catalog as an XML feed, and you want the prices in a spreadsheet. Open the .xml file in Notepad, copy everything and paste it into the left pane; the table appears on the right as soon as you paste. The tool first looks for the tag that repeats. In a feed with 250 <product> tags, each <product> becomes one row and its <name>, <price> and <stock> tags become columns. A value written inside the tag, like <product id="101">, lands in an @id column, and a nested value such as <supplier><state>OR</state></supplier> lands in supplier.state. If one product has no stock field, that cell stays empty and no row shifts. The result line reads something like "250 rows × 6 columns · row tag picked automatically: <product>"; if the pick is wrong, type the tag you want into the row tag box. The comma is the default because US and UK Excel expect it; if your Excel uses a comma as the decimal mark, pick semicolon. Values are copied as they are: 18.90 and a ZIP code like 02134 stay exactly as written.

This tool is also known as xml to csv, xml to csv converter, convert xml to csv, xml to tsv, xml to tsv converter.

What is XML?

XML stores data as nested tags: a <product> can hold <name>, <price> and <supplier>, and <supplier> can hold <state>. That tree does not fit a grid one to one, because one record may have two of a tag and the next record none. Product feeds, UBL e-invoices, bank exports and many government interfaces deliver data this way. Turning it into a table means flattening the tree: every path, such as supplier.state, becomes a column name.

What is CSV?

CSV is a plain text table: one record per line, cells separated by a delimiter. It is the simplest format every spreadsheet can open, but the delimiter is not fixed. Excel follows the region settings of the computer, so US Excel expects commas while German or French Excel expects semicolons. A UTF-8 byte order mark (BOM) at the start tells Excel the file is UTF-8, which keeps characters like é and ñ readable.

What is the difference between XML and CSV?

XML keeps a hierarchy: an order can contain a customer, the customer an address, the address a city, and every value is named by its tag. CSV knows only two dimensions, rows and columns. Going from XML to CSV loses no values but reshapes them: nested data becomes long column names like address.city, and a tag repeated inside one record becomes extra columns like tag_2. CSV is easier to filter, sort and sum in a spreadsheet; when the data has to go back into a system, you need the XML structure.

How the row tag is chosen and where nested data goes

XML is a tree and CSV is a flat grid, so the key question is which tag counts as one row. The tool looks at tags that appear at least twice under the same parent, drops those sitting inside another repeating tag, and takes the one that repeats most. That way three <phone> tags inside each <person> do not outvote two <person> tags: the row is <person>, and the phones spread into phone, phone_2 and phone_3.

If nothing repeats (a single invoice header, for example), the whole document becomes one row and the result line says so. In UBL e-invoices the line items sit in cac:InvoiceLine; typing InvoiceLine is enough, the cac: prefix is optional. Column names follow one rule: nested tags join with a dot (supplier.state), attributes get an @ (@id, supplier.@type). Namespace declarations (xmlns) are never turned into columns.

  • <product id="7"> → @id column
  • <address><city>Portland</city></address> → address.city column
  • Two <tag> elements in one product → tag and tag_2 columns
  • A field missing from one record → empty cell in that row

Comma, semicolon or tab

Excel does not read the delimiter from the file; it uses the list separator of the computer's region settings. In the US, UK, Canada and Australia that is a comma, so the comma is the default here. Where the comma is the decimal mark (most of continental Europe and Latin America), Excel expects a semicolon and shows a comma-separated file as one long column.

Tab produces a .tsv file, which databases and analysis tools read without any quoting surprises, and which pastes cleanly into any spreadsheet. A cell that contains the delimiter, a quotation mark or a line break is wrapped in double quotes and inner quotes are doubled, so "Ground coffee, 12 oz" stays in one cell. Nothing is converted: XML has no number type, so leading zeros and decimals are written as text.

Frequently asked questions

How do I convert an XML file to CSV for Excel?

Open the XML file in Notepad or TextEdit, copy everything and paste it into the left pane on this page. The repeating tag becomes the row and the tags inside it become columns. Click Download to get a .csv file; double-click it and Excel opens it with the columns in place.

The wrong tag was used for the rows. What do I do?

The result line shows which tag was picked. Type the tag you want into the "Tag that makes a row" box, for example product or InvoiceLine. You do not need angle brackets or a prefix like cac:. If the name does not exist in the XML, the error message lists the tag names it found.

Can I convert XML to TSV?

Yes. Set "Character between columns" to "Tab (TSV)" and the Download button gives you a tab-separated .tsv file. Everything else stays the same: the row tag, the supplier.state style column names and the attribute columns.

Is my XML uploaded to a server?

No. Parsing and CSV generation happen entirely inside your browser. Product lists, customer records or invoices you paste never leave this page and are not stored anywhere. Once the page has loaded, the conversion works even offline.