NF-e / NFS-e Key Reader

Decode the access key of NF-e, NFC-e, CT-e, MDF-e (44 positions) and National NFS-e (50 positions): state, date, CNPJ/CPF, model, series, number and check digit.

Processed locally — the content is never sent to the server

Fictitious examples: · · ·

How the access key is built

44 positions — NF-e, NFC-e, CT-e, MDF-e

PositionLen.Field
1–22IBGE code of the issuer's state
3–64Year and month of issue (YYMM)
7–2014Issuer's CNPJ (or CPF padded with “000” on the left). From July 2026 the CNPJ may be alphanumeric.
21–222Model (55 NF-e, 65 NFC-e, 57 CT-e, 67 CT-e OS, 58 MDF-e…)
23–253Series
26–349Document number
351Issue type (tpEmis)
36–438Random numeric code
441Check digit (modulo 11)

In CF-e SAT (model 59), positions 23–43 hold the device serial number (9), the receipt number (6) and the numeric code (6).

50 positions — National NFS-e

PositionLen.Field
1–77IBGE municipality code
81Issuing environment (1 municipality, 2 National Sefin)
91Federal registration type (1 CPF, 2 CNPJ)
10–2314Issuer's CNPJ or CPF
24–3613NFS-e number
37–404Year and month of issue (YYMM)
41–499Numeric code
501Check digit

Check digit

Each position, from right to left, is multiplied by weights 2 to 9 (restarting at 2), the results are summed and the remainder of division by 11 is computed. Remainder 0 or 1 → check digit 0; otherwise, check digit = 11 − remainder. With the alphanumeric CNPJ, each letter is worth its ASCII code minus 48 (A = 17, B = 18…).

This tool checks the key structure; it does not query SEFAZ or confirm whether the document was authorized or cancelled.