Skip to main content

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).

Waiting for generation...

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:

PositionFieldLengthMeaning & SpecificationExample
1 and 2cUF2 digitsIBGE state code of the issuing federation unit35 (SP)
3 to 6AAMM4 digitsYear and month of document issuance2609
7 to 20CNPJ14 digitsFederal taxpayer number of the issuing company00.000.000/0001-55
21 and 22mod2 digitsDocument model (55=NF-e, 65=NFC-e, 57=CT-e)55
23 to 25série3 digitsInvoice series number001
26 to 34nNF9 digitsSequential invoice number000000001
35tpEmis1 digitEmission mode (1=Normal, 2 to 9=Contingency)1
36 to 43cNF8 digitsRandom numerical security code00000001
44cDV1 digitCheck 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. 1. Iterate from position 43 down to 1 (from right to left).
  2. 2. Multiply each digit by the repeating weight sequence [2, 3, 4, 5, 6, 7, 8, 9, 2, 3...].
  3. 3. Sum all products and calculate the remainder modulo 11 (Sum % 11).
  4. 4. If remainder is 0 or 1, check digit cDV is 0.
  5. 5. If remainder is between 2 and 10, cDV is 11 - remainder.

Frequently Asked Questions & Technical Specifications