NF-e / NFC-e / CT-e Access Key Generator
Generate and format valid 44-digit Brazilian electronic invoice access keys for NF-e (mod 55), NFC-e (mod 65) and CT-e (mod 57).
About Brazilian DF-e Access Keys
The Access Key (Chave de Acesso) is a unique 44-digit numeric identifier in Brazil's SPED digital tax system representing electronic invoices: NF-e (model 55), retail NFC-e (model 65), and transport CT-e (model 57).
It encapsulates vital transaction metadata: issuing state IBGE code, year and month of issuance, issuer CNPJ, tax model, document series, sequential invoice number, emission type, random security code, and a check digit calculated via Modulo 11 with weights 2 to 9.
Anatomy & Structure of DF-e Access Key (44 Digits)
Official structure standardized by the MOC taxpayer manual and CONFAZ/ENCAT SINIEF agreements:
| Position | Field | Length | Meaning & Specification | Example |
|---|---|---|---|---|
| 1 and 2 | cUF | 2 digits | IBGE state code of the issuing federation unit | 35 (SP) |
| 3 to 6 | AAMM | 4 digits | Year and month of document issuance | 2609 |
| 7 to 20 | CNPJ | 14 digits | Federal taxpayer number of the issuing company | 00.000.000/0001-55 |
| 21 and 22 | mod | 2 digits | Document model (55=NF-e, 65=NFC-e, 57=CT-e) | 55 |
| 23 to 25 | série | 3 digits | Invoice series number | 001 |
| 26 to 34 | nNF | 9 digits | Sequential invoice number | 000000001 |
| 35 | tpEmis | 1 digit | Emission mode (1=Normal, 2 to 9=Contingency) | 1 |
| 36 to 43 | cNF | 8 digits | Random numerical security code | 00000001 |
| 44 | cDV | 1 digit | Check digit calculated via Modulo 11 (weights 2..9) | 5 |
Check Digit Verification Algorithm (Modulo 11)
Official calculation performed by Brazilian SEFAZ tax authorities on the first 43 digits:
- 1. Iterate from position 43 down to 1 (from right to left).
- 2. Multiply each digit by the repeating weight sequence [2, 3, 4, 5, 6, 7, 8, 9, 2, 3...].
- 3. Sum all products and calculate the remainder modulo 11 (Sum % 11).
- 4. If remainder is 0 or 1, check digit cDV is 0.
- 5. If remainder is between 2 and 10, cDV is 11 - remainder.