GuideNovember 5, 2026

    CNPJ with letters: where it breaks your system, and a checklist to test it

    Brazil's first company tax ID with letters came out on Jul 31, 2026. Where systems break with it, how the check digit works and how to test.

    The CNPJ is the tax ID of every company in Brazil. On July 31, 2026, Receita Federal, Brazil's federal revenue service, generated the country's first CNPJ with letters. It went to a branch of Banco do Brasil, registered as 00.000.000/E08G-12 (Receita Federal, July 31, 2026). The number sums up the problem well: the root still has digits only, and the letters appear in the part that identifies the establishment, exactly what many systems treat as "0001, 0002, 0003". Existing CNPJs do not change. What changes is that any new customer, supplier or branch can arrive with letters, and the system has to accept, store, validate and return that number without damaging it along the way.

    This guide brings together what the official sources say and points out, field by field, where a mid-sized company's system tends to treat the CNPJ as a number, and therefore breaks.

    What changed, with the official dates

    When What Source
    October 15, 2024 Publication of Normative Instruction RFB 2.229 (in force on October 25, 2024) Receita Federal, project page
    July 1, 2026 Production schema for NF-e and NFC-e (electronic invoices), with CNPJ and access key fields accepting letters NT 2026.004 v1.01
    July 1, 2026 Production XSD schemas for eSocial (the federal payroll reporting system) S-1.3 for the alphanumeric CNPJ eSocial, technical documentation
    July 6, 2026 Joint Technical Note 2025.001 in production: authorizers of NF-e, NFC-e, CT-e, MDF-e and other electronic tax documents validate the check digit with the new calculation NT Conjunta 2025.001
    July 27, 2026 Receita's CNPJ systems enter production in the new format Receita Federal, July 10, 2026
    July 31, 2026 First alphanumeric CNPJ generated Receita Federal, July 31, 2026
    August 10, 2026 National NFS-e (electronic service invoice) records, in production, the "evolution to handle the alphanumeric CNPJ" NFS-e, updates and rollouts

    Three things Receita makes clear that change the planning:

    • Whoever already has a CNPJ keeps it. Head offices, old branches and MEI (individual micro-entrepreneurs) keep their number and check digit. No re-registration is requested (FAQ, questions 6, 15 and 30).
    • The new format applies to new registrations, including branches of old companies (FAQ, question 15). A company with a numeric CNPJ can open a branch with letters in the order number.
    • The switch is gradual and random. New CNPJs "may still be issued with numeric characters only", and the alphanumeric ones will come out "gradually during 2026, with few companies in this initial period" (Receita Federal, July 31, 2026). As of the reading of these sources, there is no official calendar by type of company.

    The format and the check digit

    The CNPJ keeps 14 positions and the same mask, XX.XXX.XXX/XXXX-DV. The first 8 are the root, the next 4 are the order of the establishment, and the last two are the check digits. The first 12 can hold digits from 0 to 9 and uppercase letters from A to Z. The two check digits are still numbers only (FAQ, question 2; NT Conjunta 2025.001). The regular expression the tax documents now use is [A-Z0-9]{12}[0-9]{2}.

    The calculation is still modulo 11, with weights from 2 to 9 applied from right to left. The difference is in the value of each character: take the ASCII code and subtract 48. Digits keep the same value as always ("0" is 48 in ASCII, and 48 − 48 = 0), and letters are now worth A = 17, B = 18, C = 19 and so on. That is why every old numeric CNPJ stays valid under the new calculation.

    Receita's official example, step by step, is 12.ABC.345/01DE:

    Character 1 2 A B C 3 4 5 0 1 D E
    Value (ASCII − 48) 1 2 17 18 19 3 4 5 0 1 20 21
    Weight 5 4 3 2 9 8 7 6 5 4 3 2

    The sum of the products is 459. The remainder of 459 divided by 11 is 8, and the first digit is 11 − 8 = 3. For the second, add the 3 to the end and repeat the calculation with weights from 2 to 9 starting from the right: the sum is 424, the remainder is 6, and the second digit is 11 − 6 = 5. When the remainder is 0 or 1, the digit is 0. Result: 12.ABC.345/01DE-35 (check digit calculation manual, Receita/Serpro). Receita publishes reference routines in common languages on the same page as the manual.

    Where the system breaks

    None of the points below is exotic. Each one is a place where someone, at some point, decided the CNPJ was a number because until July 2026 it was.

    1. Numeric database column. A CNPJ stored as BIGINT, NUMERIC or DECIMAL does not accept letters. The insert fails, or, worse, an intermediate layer discards what is not a digit and writes a different number. The column has to be 14-position text, and the migration also has to look at the log, integration and history tables.
    2. Form mask and validation. A field with type="number", the mask 99.999.999/9999-99 or a "digits only" rule in the ERP, the CRM, the website, the supplier portal and the e-commerce checkout. The mask has to accept letters in the first 12 positions and only digits in the last two. It is worth converting lowercase to uppercase on input: the official format uses uppercase letters.
    3. Check digit routine. The old function, which adds up digits, does not know what to do with "E" or "G". Switching to the ASCII − 48 rule solves both formats at once, because the result for a numeric CNPJ is the same. The point of attention is that this routine tends to be copied in several places: in the front end, in the back end, in a database procedure, in an import spreadsheet.
    4. Integrations and APIs that type the CNPJ as a number. A JSON with "cnpj": 12345678000195 (no quotes) has no way to carry 00000000E08G12. The API contract has to move to a string. The same goes for fixed-position integration files declared as numeric.
    5. Leading zeros. The first alphanumeric CNPJ starts with eight zeros. Any conversion to a number along the way (a parseInt, a spreadsheet column, an integer field) turns 00000000E08G12 into garbage. Tax documents require the zeros: the NF-e layout asks for the CNPJ to be given "with the non-significant zeros" (NT 2026.004).
    6. "0001 is the head office". Many business rules decide head office and branch by looking at the order number. Receita warns that 0001 indicates the head office only at the moment of generation, that a branch can become the head office, and that "companies' systems" have to reflect this (FAQ, question 25). With letters in the order number (E08G), rules such as "order > 0001" or "ascending numeric order" stop working.
    7. Sorting, keys and deduplication. Sorting a CNPJ as a number and as text gives different results, and comparing "00000000E08G12" with a masked or lowercase version creates duplicate records. The practical rule is to always store without a mask, in uppercase, and always compare in that format.
    8. Reports, BI and spreadsheets. Dashboards that aggregate by CNPJ root, CSV extracts opened in Excel and joins on a numeric key lose or misalign records with letters. A "CNPJ between X and Y" filter also stops making sense.
    9. Tax documents and the DANFE barcode. The 44-position access key carries the issuer's CNPJ and now accepts letters in those 12 positions. The key's check digit uses the same ASCII − 48 logic. And the barcode on the DANFE (the printed companion of the NF-e), which was CODE-128C (numbers only), has to move to the hybrid 128-C with 128-A model when there are letters (NT Conjunta 2025.001). This affects whoever generates the DANFE and also whoever reads the key at the gate, at receiving or in incoming bookkeeping: a supplier with a new CNPJ will send an invoice with letters in the key.
    10. Customer and supplier records. This is where the problem appears first, because it is where third-party CNPJs come in. A new supplier does not ask permission: it simply has a number with letters. If the record refuses it, the purchase stalls; if it accepts but the integration with tax or finance refuses it, the payment stalls.
    11. Pix and billing. The alphanumeric CNPJ can be a key for Pix, Brazil's instant payment system, and whoever already has a key with a numeric CNPJ keeps it (FAQ, question 46). The system that registers, validates or reconciles Pix keys has to accept the format. For boleto (bank payment slips) and bank remittance and return files (CNAB), the official sources read do not give the layout: confirmation comes from each bank's manual.
    12. eSocial and NFS-e. eSocial put the S-1.3 schemas for the alphanumeric CNPJ into production on July 1, 2026. In the National NFS-e, the schema published as production documentation, as read on October 22, 2026, still had the pattern [0-9]{14}, and the restricted production (testing) one, from October 20, 2026, already had [0-9A-Z]{14}. Whoever issues service invoices through a municipality's own system has to confirm with the municipality, because each one has its own schedule.

    How to test

    Receita keeps the Simulador Nacional de CNPJ, a free tool that generates up to 1,000 fictitious head office and branch CNPJs per user, validates format and digits and runs in the browser, with no real data (FAQ, questions 47 to 51): https://servicos.receitafederal.gov.br/servico/cnpj-alfa/simular. Use its numbers in test environments, never a real company's CNPJ to issue a document.

    A short script, in a test environment:

    1. Register the official example 12.ABC.345/01DE-35 as a customer and as a supplier, typed with the mask, without the mask and in lowercase. The system should accept it and always store 12ABC34501DE35.
    2. Try the wrong digit, 12.ABC.345/01DE-36. The system should refuse it.
    3. Register a branch CNPJ with letters in the order number, generated by the simulator, and one with leading zeros, like the first real CNPJ (root 00.000.000, order E08G). These are the cases that catch the head office and branch rules and the loss of zeros.
    4. Follow the record to the end of the road: order, invoice issued in the test environment, receivable or payable, file for the bank, BI report, export to the accountants. Wherever the number appears different from what was typed, you have found the breaking point.
    5. Check the old CNPJ after switching the routine. A valid numeric CNPJ from before has to stay valid, with the same digit.

    When this guide does not apply to you

    • If no system in the company receives third-party CNPJs (customer, supplier, carrier), the immediate risk is lower. It comes back the day the company opens a new branch, which may receive a number with letters.
    • If all invoicing and bookkeeping stay in a system of your accountants, the tax checks belong to whoever operates that system. Records, billing, website and BI are still the company's.
    • If you are reading after March 31, 2027, check the official pages for a calendar by type of company, new technical notes or a change in the accepted letters.

    Checklist

    • CNPJ columns in the database converted to 14-position text, including log and integration tables
    • Masks and validations accepting letters in the first 12 positions, in ERP, CRM, website, supplier portal and checkout
    • Check digit routine switched to the ASCII − 48 rule, everywhere it was copied
    • API contracts and integration files passing the CNPJ as text
    • Leading zeros preserved end to end
    • Head office and branch rules that depend on "0001" reviewed
    • Reports, BI and exports checked with a CNPJ with letters
    • Generating and reading the access key and the DANFE barcode tested with letters
    • Remittance and return layout confirmed with each bank
    • Test in a test environment with 12.ABC.345/01DE-35 and with numbers from the Simulador Nacional de CNPJ

    Under the schedule in NT Conjunta 2025.001, since July 6, 2026 the authorizing state tax offices (SEFAZ) have been validating the CNPJ check digit on electronic tax documents with the new calculation, whether the number is numeric or alphanumeric.