alphanumeric CNPJ: what it is and how to test it
From July 2026 the Receita Federal issues CNPJ numbers whose first 12 positions can hold letters as well as digits, because the numeric combinations are running out. Systems that store the CNPJ as a number or a 14-digit text field need to change, and developers need valid alphanumeric samples to test them.
For tests only. These numbers have a correct format and check digit but belong to no real person or account. Never use them to deceive, to open accounts or to bypass a check. The numbers on this page come from the same generator as the tool, with a fixed seed so that the examples do not change; the tool creates new ones at every click.
Structure of the number
Still 14 positions: 12 of root and branch, which may be A to Z and 0 to 9, and 2 check digits, which are always numeric. The mask is the same (00.000.000/0000-00); existing numeric CNPJ keep working unchanged.
The check digit, step by step
The rule is the same module 11 as the numeric CNPJ, with one change: each character is first converted to a value equal to its ASCII code minus 48. Digits keep their value (0 to 9) and letters become 17 (A) to 42 (Z). The weights 5 4 3 2 9 8 7 6 5 4 3 2 and then 6 5 4 3 2 9 8 7 6 5 4 3 2 are applied to these values exactly as before.
Worked example with 0H.H40.VYD/BRVR-38:
First check digit, weights 5 4 3 2 9 8 7 6 5 4 3 2:
| Position | Character | Value | Weight | Product |
|---|---|---|---|---|
| 1 | 0 | 0 | 5 | 0 |
| 2 | H | 24 | 4 | 96 |
| 3 | H | 24 | 3 | 72 |
| 4 | 4 | 4 | 2 | 8 |
| 5 | 0 | 0 | 9 | 0 |
| 6 | V | 38 | 8 | 304 |
| 7 | Y | 41 | 7 | 287 |
| 8 | D | 20 | 6 | 120 |
| 9 | B | 18 | 5 | 90 |
| 10 | R | 34 | 4 | 136 |
| 11 | V | 38 | 3 | 114 |
| 12 | R | 34 | 2 | 68 |
Sum = 1295; 1295 mod 11 = 8, so the first check digit is 3.
Second check digit: the 12 characters plus the first check digit, weights 6 5 4 3 2 9 8 7 6 5 4 3 2:
| Position | Character | Value | Weight | Product |
|---|---|---|---|---|
| 1 | 0 | 0 | 6 | 0 |
| 2 | H | 24 | 5 | 120 |
| 3 | H | 24 | 4 | 96 |
| 4 | 4 | 4 | 3 | 12 |
| 5 | 0 | 0 | 2 | 0 |
| 6 | V | 38 | 9 | 342 |
| 7 | Y | 41 | 8 | 328 |
| 8 | D | 20 | 7 | 140 |
| 9 | B | 18 | 6 | 108 |
| 10 | R | 34 | 5 | 170 |
| 11 | V | 38 | 4 | 152 |
| 12 | R | 34 | 3 | 102 |
| 13 | 3 | 3 | 2 | 6 |
Sum = 1576; 1576 mod 11 = 3, so the second check digit is 8. The check digits are 38.
Valid examples
Five numbers generated by the tool with a fixed seed, each one accepted by its validator:
| Example (formatted) | Without mask | Validator |
|---|---|---|
0H.H40.VYD/BRVR-38 | 0HH40VYDBRVR38 | valid |
P0.NPC.6SU/J9HP-76 | P0NPC6SUJ9HP76 | valid |
E6.7AR.C1D/MQHP-61 | E67ARC1DMQHP61 | valid |
8S.F22.NLJ/96EV-08 | 8SF22NLJ96EV08 | valid |
7I.V8Y.7WU/MP03-06 | 7IV8Y7WUMP0306 | valid |
How the validator answers
The same first example, one with a changed ending and one truncated, checked by the validator:
| Value | Result | Reason |
|---|---|---|
0H.H40.VYD/BRVR-38 | valid | - |
0HH40VYDBRVR39 | invalid | the check digit should be 38 |
0HH40VYDBRVR | invalid | needs 14 characters |
Common mistakes
- Do not use the position of the letter in the alphabet (A = 1) as its value: the Receita uses ASCII minus 48, so A is 17. With A = 1 every sample with a letter fails the check digits.
- Columns typed as integer, validations such as "only digits" and regular expressions like \d{14} reject the new numbers: the safe type is text of 14 characters, upper case, and the check digits are the only ones that must be numeric.
Frequently asked questions
Do old numeric CNPJ stop being valid?
No: numbers already issued stay as they are. The alphanumeric format applies to registrations made from July 2026, and the two formats coexist; the numeric rule is the particular case without letters.
Can I trust this generator for tests of my system?
For format and check digits, yes: the algorithm is the one published by the Receita Federal and the page shows the arithmetic. The numbers are not registered, so they will not pass a query to the Receita.
Can I use a alphanumeric CNPJ number generated here in a real system?
No. A number such as 0H.H40.VYD/BRVR-38 has a correct format and check, but nobody was issued it, and it may coincide with a real holder by chance. Use it in test environments, demos and automated tests that never leave your control.