NF-e XML to DANFE

Drop your NF-e .xml files, or a .zip with a month of them, and click Generate DANFE. You'll see the issuer, recipient, total and access key of every note, a PDF for each one and a button that downloads them all in a single ZIP.

NF-e XML to DANFE

Generate the DANFE from the NF-e XML, with the Code 128 access key barcode, taxes, freight and every item. One note or a whole month in a ZIP, done in your browser.

Drop your NF-e XML files here or click to choose them

NF-e model 55 .xml files (authorized nfeProc or plain NFe), as many as you like, or a .zip full of them

NFC-e (model 65), CT-e and event XMLs such as cancellations are not supported.

Your XML files are read inside this browser. Nothing is uploaded.

Why this exists

In Brazil the electronic invoice, the NF-e, is an XML file. It's signed by the issuer, sent to the state tax office (SEFAZ) and authorized there. That XML is the legal document. The DANFE, short for Documento Auxiliar da Nota Fiscal Eletrônica, is the printed companion: the A4 page that travels with the goods, gets signed on delivery and ends up in the accountant's folder.

Most of the time the DANFE comes straight out of the issuer's ERP. The trouble starts when all you have is the XML. A supplier emails only the .xml. Your accountant pulls a month of notes from the SEFAZ portal or from a document manager, and it's a ZIP with two hundred XML files. Or the old billing system is gone and the PDFs went with it.

The free DANFE sites I tried before writing this one all work the same way: one file at a time, a captcha, a page full of ads, and your note uploaded to a server you know nothing about. That's fine for one note. On a forum for Brazilian accountants someone asked how to do a whole month at once, and the honest answer was that nobody offered it. So that's the point of this tool. Drop a ZIP, get a ZIP back.

What's on the DANFE

The layout follows the standard portrait DANFE that anyone in Brazil will recognize, block by block:

  • The canhoto at the top, the tear-off receipt with the issuer name, issue date, total and recipient, plus the space for the date and signature
  • The issuer block with name, address, CEP and phone
  • The DANFE box with 0 for entrada or 1 for saída, the note number, the series and the sheet count (FOLHA 1/2)
  • The 44-digit access key in groups of four, with its Code 128C barcode so it can be scanned
  • Natureza da operação and the SEFAZ authorization protocol with date and time
  • State registration (IE), IE of the tax substitute and the issuer's CNPJ
  • Recipient name, CNPJ or CPF, address, district, CEP, city, phone, IE, issue date and departure date and time
  • Invoice and installments (fatura and duplicatas), or the payment method when there are no installments, PIX included
  • The tax calculation block: ICMS base and value, ICMS ST, import tax, PIS, COFINS, freight, insurance, discount, other charges, IPI, ICMS for the destination state, the approximate tax total and the note total
  • Carrier, freight terms, ANTT code, plate, volumes, species, brand and gross and net weight
  • The product table with code, description, NCM, CST or CSOSN, CFOP, unit, quantity, unit price, total, ICMS base, ICMS, IPI and both rates
  • Additional information (informações complementares) and the space reserved for the tax office

Long notes run onto as many pages as they need. Every extra page repeats the issuer, DANFE box and access key, and the product table picks up where it stopped. A note with forty items comes out as two pages, FOLHA 1/2 and FOLHA 2/2, the way an ERP would print it.

How to use it

  1. Drop one or more .xml files onto the box, or a .zip that has them inside. Folders inside the ZIP are fine.
  2. Click Generate DANFE.
  3. A table lists every note with issuer, recipient, total and access key. Open any PDF to check it, download it on its own, or grab the whole batch as one ZIP.

Each PDF keeps the name of its XML. Notes downloaded from SEFAZ are usually named after the access key, so the PDFs line up one to one with the XMLs in your folder.

A whole month at once

If your accountant would rather get one file for the month, merge the DANFEs into a single PDF after you download the ZIP.

This was the part I cared about most. You can drop a ZIP with hundreds of notes and get a ZIP with hundreds of DANFEs back. A few hundred notes take a few seconds on an ordinary laptop, since nothing travels over the network. Up to 1,000 XML files go in one batch.

A broken file, an NFC-e that slipped into the folder or a cancellation event doesn't stop the batch. It shows up in the table with the reason, and everything else converts as usual.

Real situations

Looking for the note that had a certain product or CNPJ? Once the DANFEs are on your disk you can search all the PDFs at once instead of opening them one by one.

You're an accountant closing the month for a client. The client sent a ZIP of XMLs from the SEFAZ portal and you need printable copies for the file. Drop the ZIP, download the ZIP of DANFEs, and move on to the next client.

You receive goods and the supplier sent only the XML. The warehouse wants the paper to check the load against. Generate the DANFE here, print it, and the receiver can sign the canhoto.

You work at a company abroad with a Brazilian supplier. The XML means nothing to your approval workflow, but a PDF with the issuer, the CNPJ, the items and the total does. The layout is in Portuguese, as the DANFE has to be, and the numbers are easy to find.

You're going through old notes for an audit. The system that issued them is gone, but the XMLs are still in the archive. Older 3.10 layout files usually work too, since the fields that go on the DANFE kept the same names.

Authorized or not

An authorized note normally comes as an nfeProc file, which holds the NF-e plus the protNFe with the SEFAZ protocol number. That protocol goes into the DANFE header with its date and time.

If you drop a bare NFe file with no protocol, the tool still builds the DANFE so you can look at it, but it prints SEM VALOR FISCAL diagonally across every page and says so in the protocol box and in the additional information. The same mark appears on notes issued in the homologation (test) environment. A draft that never went through SEFAZ shouldn't look like a valid DANFE, and this one won't.

What the tool can't know is whether a note was cancelled later. Cancellation is a separate event file, and the original XML doesn't change. Before paying a large note from a new supplier, check the access key on the national NF-e portal.

Privacy

Your XMLs are read with the browser's own file functions and the PDFs are drawn on your computer. Nothing is uploaded and nothing is stored. Load the page, switch off the Wi-Fi and convert a ZIP of notes: it still works. Notes carry CNPJs, CPFs, home addresses and amounts, and I'd rather that data never left your machine.

The page also refuses XML files with DOCTYPE or entity declarations. Real NF-e files never use them, and blocking them shuts out a known family of malicious XML tricks. ZIP files are capped by entry count and by total unpacked size, so a booby-trapped archive can't eat all your memory.

What it won't do

Got Mexican invoices too? The CFDI XML to PDF converter does the same job for SAT CFDI files.

It handles NF-e model 55 only. NFC-e (model 65) uses a narrow receipt layout with a QR code instead of the DANFE, and it isn't supported here. CT-e, MDF-e and NFS-e aren't supported either, and neither are event XMLs such as cancellations or correction letters (carta de correção). The DANFE comes in portrait only, with no logo, so it prints cleanly in black and white on any printer.

If you need something it doesn't do yet, use the feedback link on this page. I read every message.

Frequently Asked Questions About Generating a DANFE from NF-e XML

Similar tools to explore

VCF to CSV Converter

Convert VCF to CSV or Excel in your browser. Merge several vCard files, remove duplicate contacts and get one clean spreadsheet. Nothing is uploaded.

Convert to CSV

CFDI XML to PDF

Turn Mexican CFDI 4.0 and 3.3 XML invoices into printable PDFs with the SAT QR code, UUID and digital seals. One file or a whole ZIP from the SAT, converted in your browser.

Convert to PDF

Tab Delimited File to Excel Converter

Paste tab-separated data or upload a .tsv file and get back a clean XLSX with the columns lined up. No account, and an uploaded file is deleted the moment the conversion finishes.

Convert to Excel

Google Maps Timeline Viewer

Open your Google Maps Timeline export right in the browser: coverage calendar, missing days, visits, and distance stats. The file never leaves your device.

View My Timeline

E-Invoice Viewer

Drop an XRechnung or UBL XML file, or a ZUGFeRD or Factur-X PDF, and read it as a normal invoice. Totals and VAT get checked, and nothing leaves your browser.

View Invoice

JSON to TOON Converter

Convert JSON to TOON and TOON back to JSON, with a real GPT token count for both so you can see how many tokens you save. Runs in your browser.

Convert to TOON