Brazil’s CNPJ business registration number is starting to accept letters as well as numbers in its identification positions. The change expands the number of available registrations and requires systems, integrations, and test routines to understand the new format.
The CNPJ Generator and Validator on fasttools.dev already supports the alphanumeric format as well as legacy numeric CNPJs. You can generate fictional registrations, validate check digits, and test your application changes without using real company data.
Quick answer
The new CNPJ still has 14 positions. The first 12 may contain uppercase letters and digits, while the final two positions remain numeric check digits. Its familiar display format remains SS.SSS.SSS/SSSS-NN.
Existing numeric CNPJs remain valid. The alphanumeric format is intended for new registrations, so applications should accept both formats during the transition.
What changed in the CNPJ standard
The first 12 positions used to be numeric only. In the new format they are alphanumeric:
- positions 1 to 8 identify the registration root;
- positions 9 to 12 identify the establishment order;
- positions 13 and 14 are numeric check digits.
A fictional example is 12.ABC.345/01DE-35. The punctuation is unchanged, which keeps the value readable in forms, reports, and test documentation.
According to the Brazilian Federal Revenue Service, existing registrations continue to be valid. Systems that receive CNPJ values must stop assuming that every character is a digit.
How the validation algorithm works
The calculation still uses modulo 11 and two check digits. The difference is the conversion performed before multiplying each position by its weight:
- digits keep their numeric value;
- each letter uses its ASCII value minus 48;
- for example,
A = 17,B = 18, andZ = 42.
For the first check digit, the 12 values use weights 5,4,3,2,9,8,7,6,5,4,3,2. Divide the sum by 11: a remainder of 0 or 1 produces digit 0; otherwise the digit is 11 - remainder.
For the second check digit, append the first digit and repeat the calculation with weights 6,5,4,3,2,9,8,7,6,5,4,3,2. This is the method described in the Federal Revenue Service technical material.
Generate alphanumeric CNPJ values for tests
Open the CNPJ Generator, choose Alphanumeric (new format), and select the quantity, mask, and output format. Results can be copied or downloaded as TXT, CSV, JSON, or a table.
The validation area also accepts masked or unmasked CNPJ values and checks both the structure and the two check digits.
Mathematical validity is not a real company
A value that passes the check-digit algorithm is structurally valid, but it does not prove that it belongs to an active company. The generator does not query the Federal Revenue Service database. Use generated values only for development, QA, staging, and automated tests.
Do not use generated CNPJ values in tax documents, real registrations, commercial operations, or banking flows.
Next step
If you are adapting an API, form, or database, test both formats now. Open the CNPJ Generator and Validator, create alphanumeric examples, and validate your application’s rules before production.
