Skip to main content

National NFS-e Access Key Validator

Validate structural authenticity, issuing municipality, federal tax ID, and Modulo 11 check digit of 50-digit Brazilian National NFS-e keys.

About National NFS-e Validation

Validation inspects the 50-digit sequence (or 53 digits if prefixed with 'NFS'), municipal IBGE code, CPF or CNPJ structural legitimacy, and Modulo 11 check digit precision.

Access key inconsistencies cause tax rejection in corporate ERPs and municipal tax gateways (Sefin).

Anatomy & Structure of National NFS-e Key (50 Digits)

Official structure standardized by the National NFS-e Taxpayer Manual (MOC):

PositionFieldLengthMeaning & SpecificationExample
01 to 07cMun7 digitsIBGE code of the municipality where ISS tax applies3550308 (SP)
08tpAmb1 digitIssuing environment (1=Municipal System, 2=National)2
09tpInsc1 digitIssuer ID type (1=CPF, 2=CNPJ)2
10 to 23Insc14 charactersFederal Tax ID (CPF with 3 leading zeros or CNPJ)00000000000191
24 to 36nNFSe13 digitsNFS-e sequential invoice number in National Environment0000000000001
37 to 40AAMM4 digitsYear and month of document issuance2609
41 to 49cNFSe9 digitsRandom numerical security code123456789
50cDV1 digitCheck digit calculated via Modulo 110

Check Digit Calculation Algorithm (Modulo 11)

Official calculation performed by tax authorities on the first 49 positions:

S = Σ(d_i * weight_i) | DV = rem < 2 ? 0 : 11 - rem
  1. 1. Iterate from position 49 down to 1 (from right to left).
  2. 2. Convert characters to numeric values (ASCII - 48).
  3. 3. Multiply each value by cyclic weights [2, 3, 4, 5, 6, 7, 8, 9, 2, 3...].
  4. 4. Sum all products and calculate the remainder modulo 11 (Sum % 11).
  5. 5. If remainder is 0 or 1, check digit is 0; otherwise it is 11 minus remainder.

Frequently Asked Questions & Technical Specifications