NF-e / NFC-e / CT-e Access Key Validator
Validate structural authenticity, embedded metadata, and check digit of 44-digit Brazilian DF-e access keys.
About DF-e Access Key Validation
Validation inspects the 44-digit numeric sequence, Brazilian state IBGE code legitimacy, emission date integrity (month/year), and Modulo 11 check digit accuracy.
Access key formatting errors are a primary cause of rejection in tax messaging software, ERPs, and invoicing gateways (SEFAZ rejections 225, 226, 253).
Anatomia & Estrutura da Chave de Acesso (44 Dígitos)
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:
S = Σ(d_i * weight_i) | DV = rem < 2 ? 0 : 11 - rem
- 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.