XML to Excel converter

Open an XML file — an NFS-e, an NF-e, or any other format — and the tool turns it into a spreadsheet: every element becomes a column whose name is the path down to it, and you download CSV or Excel. Nothing is sent to a server: reading, flattening and writing all happen in your browser.

Pick the XML files, or drop them here.

Several files at once is fine: they become rows of the same spreadsheet.

Spreadsheet options

This tool handles up to 10 MB per batch. The ceiling exists because the whole XML becomes text in your browser memory — beyond that the tab freezes instead of delivering the spreadsheet.

The column name is the full path, and that is what makes the sheet usable. “emit/CNPJ” and “toma/CNPJ” come out as two separate columns even though the element name repeats in the file; the “versao” attribute sitting on the root gets its own column, written with an @ in front. An XML with fifty text values produces around fifty columns.

Batches are the normal case: pick ten or a hundred files at once and they become ten or a hundred rows of one sheet, with the columns unioned across them. If one file carries a field the others do not, that column still exists and simply stays empty where there is no value — no per-file spreadsheet you then have to merge by hand.

How to use

  1. Drop the XML files on the area, or use the file picker. Mixing invoices from different periods is fine: a column is decided by the path inside the file, not by the order the files arrived in.
  2. Check the summary before downloading: column count, data row count, and the encoding the tool actually read from each file. This is where you can see, on screen, that an XML arrived as latin1 when you expected utf-8.
  3. If the batch has a repeated element — the service items of an NF-e, say — the “one row per repeated element” box arrives already ticked, and each occurrence gets its own row. Untick it if you would rather have everything concatenated in one cell.
  4. Pick your download. CSV opens with the accents intact because it ships with a BOM up front and quotes every field containing a comma, a quote or a line break; XLSX is a native workbook, with the sheet named after the file.

What becomes a column, what becomes a row, what stays out

A column is the element path joined with dots, keeping the namespace prefix exactly as the file writes it. That is the whole design: the tool does not guess what anything means, it reports where the value sat. A field that appears under two different parents shows up twice in the sheet, which is precisely how you find out which of the two is wrong.

The file is read as text before any parsing, and the encoding is decided during that read: a BOM wins; without one the bytes are tested as utf-8 and, if they fail, fall back to latin1 — which covers the windows-1252 many fiscal files arrive in. The encoding used is written into the summary, because guessing quietly is how an accent turns into a question mark in your sheet.

What the tool does not do fits in one line: it does not validate a layout or a schema, it does not check a check digit, it does not verify tax authorisation, and it is not a substitute for the official extract. It reads what the file says and hands you the sheet. A malformed XML returns a named error instead of a partial sheet, and a well-formed but semantically wrong file still lands in the sheet — because the tool never judges content.

There is a stated ceiling: 10 MB across the whole batch. It is not a usage limit, it is the point where an XML turned into text in memory starts freezing the tab instead of delivering a spreadsheet. Any cell longer than 32,767 characters is cut in both outputs — for Excel that is a rule of the format, and in CSV it is what stops one long value from splitting a row in half.

In the fileIn the sheetWhy
“emit” and “toma”, each holding a “CNPJ”Two columns: emit.CNPJ and toma.CNPJA column is the path, not the node name; merging the two hides which side is wrong.
An attribute on the root, such as versao="1.00"Its own column, written _root.@versaoAn attribute is not a child, and the @ keeps it from ever colliding with an element of the same name.
A repeated element, like ten service itemsOne row per occurrence while the box is tickedJamming them into one cell works, but leaves you nothing to sum, filter or sort afterwards.
A “Signature” block with the certificate insideLeft out, with the discard box tickedThousands of base64 characters nobody looks for in a spreadsheet — and the box lets you bring them back.
An element that is empty or self-closingAn empty cellAn empty cell is what Excel can filter; writing the word “undefined” there would turn absence into data.
An xmlns declaration on an elementNever becomes a columnIt is namespace metadata, it repeats in every file, and it carries no value from the document.

Frequently asked

Does it work with NF-e model 55 files?
It works with any well-formed XML, and the flattening handles what makes an NF-e different: a repeated group turning into rows, the “nfe:” prefix preserved as written, and the version attribute on the root getting its own column. What this page does not claim is conformance: no real NF-e file was verified here, so treat the result as reading your own file, not as validating it.
My file has accents and they came out garbled in Excel. Is that the tool’s fault?
Usually not. The reader decides the encoding by looking at the BOM and testing the bytes, and the CSV ships with a utf-8 BOM so Excel opens it correctly on a double click. If text still arrives garbled, look at what the summary reports as the encoding read: when a file declares utf-8 but is really latin1, the tool follows the bytes rather than the declaration.
Can I merge files from different municipalities into one sheet?
You can, and the column union is what makes it work: each file brings the columns it has, and where one of them lacks a field the cell stays empty. What you should not expect is layout mapping — “ItemLista” from one city and “servico” from another are two separate columns, because the tool does not decide they mean the same thing.
Does the tool check whether the XML was authorised?
No. It reads the document and represents it as rows and columns. Checking authorisation means submitting the file to the tax authority’s authorising environment and reading the response, which does not happen here — and could not, since nothing leaves this browser. The official extract remains the authority’s word.
Does my file get uploaded anywhere?
It does not. There is no network call in this tool: the file is read by your own browser, the text is processed there, and the CSV or XLSX is assembled and handed back as a local download. You can verify it with the browser’s network panel open, or even with the internet switched off once the page has loaded.
CSV or Excel: which one should I download?
The content is identical, row for row. CSV is plain text, opens everywhere, and is what you want if a script will process it later; Excel arrives as a real workbook with a named sheet, and keeps identifiers (CNPJ, CPF, a CEP with its leading zero) as text — which is exactly what CSV tends to render in scientific notation if you open it carelessly.

Related tools