Free tool
Brazilian NFe key decoder
Paste a 44-digit Brazilian electronic invoice key (from the footer of any NFe) and see what each field means — issuing state, CNPJ, model, series, number, and more.
How the NFe key is structured
The Brazilian NFe access key is a 44-digit unique identifier defined by SEFAZ (Technical Note 2011/004). It appears in the footer of any Electronic Invoice, DANFE, or XML and has the following structure:
cUF(2) AAMM(4) CNPJ(14) mod(2) serie(3) nNF(9) tpEmis(1) cNF(8) cDV(1)
- cUF (2) — IBGE code of the issuing state (e.g., 35=SP, 33=RJ, 31=MG, 53=DF) - AAMM (4) — year-month of issue (2-digit year + 2-digit month) - CNPJ (14) — issuer CNPJ - mod (2) — document model (55=NF-e, 65=NFC-e consumer, 57=CT-e freight bill) - serie (3) — NFe series - nNF (9) — sequential invoice number - tpEmis (1) — emission type (1=normal, 2..9=contingencies) - cNF (8) — random numeric code to avoid collisions - cDV (1) — mod-11 check digit over the preceding 43 digits
This decoder validates the check digit with the official algorithm and identifies the state, region, model, and emission type.
Frequently asked questions
How do I read the 44 digits of an NFe access key?
Left to right: 2 digits issuer state (IBGE code), 4 digits AAMM (year-month), 14 issuer CNPJ, 2 model (55=NF-e, 65=NFC-e, 57=CT-e), 3 series, 9 sequential number, 1 emission type (1=normal, 2-9=contingencies), 8 random numeric code, 1 mod-11 check digit. This decoder extracts each field with validation.
What is the difference between NF-e (55), NFC-e (65) and CT-e (57)?
NF-e (model 55) = Electronic Invoice, for B2B and B2C with formal delivery. NFC-e (65) = Consumer Invoice, issued in retail/e-commerce for consumer CPF. CT-e (57) = Electronic Transport Manifest, for logistics operations. Each model has different layout and tax obligations.
Why validate an NFe key in a Brazilian court process?
NFe keys are attached in tax enforcement cases, ICMS/ISS tax disputes, organized crimes against tax order, and commercial disputes (default, product defect, return). Decoding the key before attaching it to the court process avoids errors in model/state/issuer identification.
Does the state code (first 2 digits) use IBGE codes?
Yes. The first 2 digits follow IBGE 2-digit codes: 35=SP, 33=RJ, 31=MG, 29=BA, 23=CE, 53=DF, etc. This decoder shows the state name and region automatically, useful for understanding invoice origin in inter-state tax litigation.
Does the NFe key reveal the invoice value?
No. The 44 digits contain only metadata (issuer, date, model, series, number, emission type) — no value, products, or recipient. To get the full XML and values, a direct query to the originating SEFAZ portal is required, with authorization from the issuer or recipient.
Related tools
Looking for tax enforcement cases?
Vigilant searches for labor lawsuits, tax enforcement actions, and court cases tied to a CNPJ across 12 Brazilian court sources.
Search cases for this company