PureTools

CNPJ Generator & Validator

Generate and validate numeric and alphanumeric CNPJs (new 2026 format). Official algorithm with check digits.

93.021.106/0001-52
How are the check digits calculated?

1. Character conversion

Each character is converted to a numeric value using the formula: ASCII code − 48. This results in: 0→0, 1→1, ..., 9→9, A→17, B→18, ..., Z→42.

CharASCIIDV Value
0480
1491
2502
3513
4524
5535
6546
7557
8568
9579
A6517
B6618
C6719
D6820
E6921
F7022
G7123
H7224
I7325
J7426
K7527
L7628
M7729
N7830
O7931
P8032
Q8133
R8234
S8335
T8436
U8537
V8638
W8739
X8840
Y8941
Z9042

2. Weight multipliers

Values are multiplied by specific weights from right to left:

DV1: [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]
DV2: [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]

3. Modulo 11 calculation

  1. Multiply each value by its corresponding weight
  2. Sum all products
  3. Calculate remainder: sum % 11
  4. If remainder < 2 → DV = 0. Otherwise → DV = 11 − remainder

4. Example with alphanumeric CNPJ

CNPJ: 12ABC34501DE
Values: [1, 2, 17, 18, 19, 3, 4, 5, 0, 1, 20, 21]
DV1: (1×5)+(2×4)+(17×3)+(18×2)+(19×9)+(3×8)+(4×7)+(5×6)+(0×5)+(1×4)+(20×3)+(21×2) = 459
459 % 11 = 8 → DV1 = 11 − 8 = 3
DV2: Include DV1 and recalculate with DV2 weights5
Result: 12.ABC.345/01DE-35
Note: The Brazilian IRS recommends NOT using letters I, O, Q and F in new alphanumeric CNPJs, due to possible visual confusion with numbers (1, 0) and collisions in DV calculations.

What is it?

CNPJ Generator & Validator is a free online tool that runs entirely in your browser. Generate and validate numeric and alphanumeric CNPJs (new 2026 format). Official algorithm with check digits. No data is sent to any server — all processing happens locally on your device, ensuring complete privacy and security. Whether you're a developer, designer, student, or professional, this tool saves you time by providing instant results without requiring any software installation or account creation.

How to use

Using CNPJ Generator & Validator is straightforward. Simply enter or paste your data in the input field, configure any available options, and click the action button to process. The result appears instantly in the output area. You can copy the result to your clipboard with one click. If you need to start over, just clear the input and try again. The tool accepts a wide range of inputs and handles edge cases gracefully.

When to use

CNPJ Generator & Validator is useful in many everyday scenarios. Developers use it during coding sessions to quickly process data without leaving the browser. It's also perfect for one-off tasks where installing a dedicated application would be overkill. Students and learners find it helpful for understanding how the underlying process works. Since it's web-based, you can use it from any device — desktop, laptop, tablet, or phone — without any setup.

Frequently Asked Questions

Is CNPJ Generator & Validator free to use?
Yes, CNPJ Generator & Validator is completely free with no usage limits, no account required, and no ads that block functionality. All features are available immediately.
Is my data safe when using CNPJ Generator & Validator?
Absolutely. All processing happens directly in your browser using JavaScript. Your data never leaves your device and is never sent to any external server. You can verify this by checking your browser's network tab.
Does CNPJ Generator & Validator work on mobile devices?
Yes, the tool is fully responsive and works on all modern browsers including Chrome, Firefox, Safari, and Edge on any device — desktop, tablet, or smartphone.
Do I need to install anything to use CNPJ Generator & Validator?
No installation is needed. CNPJ Generator & Validator runs entirely in your web browser. Just open the page and start using it immediately. There's no signup, no download, and no browser extension required.

Related Tools