QuickUse Generator

Alphanumeric CNPJ Check Digit Calculator

Calculate the two check digits of the new alphanumeric CNPJ (módulo 11) and see the full math: ASCII−48 conversion, weights, weighted sum and the remainder rule. 100% in your browser.

Mode

Editorial guide

About this generator

An honest technical read on what is happening behind the Generate button.

From July 2026, Brazil's company tax ID — the CNPJ — starts accepting letters. New registrations get an alphanumeric CNPJ: the first twelve positions can be digits 0-9 or uppercase letters A-Z, while the last two — the check digits — stay strictly numeric. This calculator takes those twelve positions and computes the two check digits the way Serpro and Receita Federal specify, and it shows the full working: the ASCII−48 conversion, the weights, the weighted sum, the remainder, and the rule. The canonical example, 12ABC34501DE, yields 35 — the complete CNPJ 12.ABC.345/01DE-35.

Why the CNPJ is getting letters

The CNPJ is a fourteen-position identifier administered by Receita Federal, Brazil's federal tax authority. Until now it has been purely numeric, which caps the number of distinct roots at one hundred million. That ceiling is in sight, so Instrução Normativa RFB nº 2.229/2024 introduced an alphanumeric format that multiplies the address space dramatically. The change is forward-only: it applies to new registrations from July 2026. Every existing all-numeric CNPJ stays exactly as it is and remains valid under the same rules. If you want the full timeline and migration picture, we wrote a deeper guide on what changes with the alphanumeric CNPJ.

The format: twelve alphanumeric, two numeric

The fourteen-position length does not change, and neither does the mask XX.XXX.XXX/XXXX-XX. What changes is the alphabet of the first twelve positions — the eight-position root plus the four-position branch identifier. Those twelve can now mix digits and uppercase letters. The final two positions, the verifier digits, are computed from the first twelve and are always numeric. So a valid alphanumeric CNPJ matches the pattern [A-Z0-9]{12}[0-9]{2}.

How the check digits are computed

The algorithm is the same módulo 11 scheme the numeric CNPJ already uses — the only new step is converting each character to a number. Serpro's specification is precise: the value of a character is its ASCII code minus 48. That makes '0' through '9' map to 0 through 9, exactly as before, and the letters follow on: A = 17, B = 18, … , Z = 42. Because digits map to their own value, a purely numeric CNPJ produces the identical result it always has — the alphanumeric algorithm is a strict superset.

With the twelve values in hand, the first check digit is a weighted sum using the weights 5 4 3 2 9 8 7 6 5 4 3 2 (left to right). Take that sum modulo 11; if the remainder is 0 or 1 the digit is 0, otherwise it is 11 − remainder. The second check digit appends the first to the twelve values and repeats the weighted sum with 6 5 4 3 2 9 8 7 6 5 4 3 2, applying the same remainder rule. For 12ABC34501DE the first pass sums to 459 (459 mod 11 = 8, so 11 − 8 = 3) and the second sums to 424 (424 mod 11 = 6, so 11 − 6 = 5) — check digits 35. The calculator above lays out every term so you can audit the arithmetic, not just trust it.

Backward compatibility is total

This is the reassuring part for anyone maintaining existing systems: the alphanumeric rules do not break numeric CNPJs. A classic CNPJ such as 11.444.777/0001-61 still validates, because under ASCII−48 its digits keep their plain values and the weights and remainder rule are unchanged. You do not need two algorithms — you need one algorithm that happens to accept letters. The practical work is mostly at the edges: widen the column types that store a CNPJ from numeric to text, update any ^\d{14}$ regular expression to ^[A-Z0-9]{12}[0-9]{2}$, and make sure your check-digit routine converts characters with ASCII−48 rather than parsing integers.

A note on ambiguous letters

A common question is whether every letter is allowed. The check-digit validation accepts the full A-Z range — a CNPJ containing I or O that satisfies módulo 11 is structurally valid. Separately, the technical group ENCAT recommended in Nota Técnica Conjunta 2025.001 that Receita avoid issuing the visually ambiguous letters I O U Q F (to prevent confusion with 1 and 0, and to dodge unfortunate character combinations). At the time of writing that exclusion is a recommendation pending confirmation, not a validation rule — so a validator should accept those letters, while a generator of test data does well to avoid them by default.

Who needs this, and what comes next

If you write ERP, accounting, billing, NF-e, or KYC software that touches Brazilian companies, the alphanumeric CNPJ lands in your validation layer whether you opt in or not — a new customer registered after July 2026 can have letters in their ID, and a numeric validator will wrongly reject them. The cheapest insurance is to fix the check-digit routine now and test it against valid alphanumeric samples. This calculator is the single-CNPJ tool; for checking an ID you already have, reach for a validator, and for producing batches of valid test data, a generator — both built on the same verified módulo 11 core. If you also work with the existing numeric format, the test-only CNPJ generator covers that. Everything here runs entirely in your browser: nothing you type is sent anywhere.

Frequently asked questions

What is the alphanumeric CNPJ and when does it start?

It is the new format of Brazil's company tax ID. From July 2026, new registrations get a CNPJ whose first twelve positions may contain uppercase letters A-Z as well as digits 0-9; the last two positions (the check digits) stay numeric. It was introduced by Instrução Normativa RFB nº 2.229/2024 to expand the address space, which the purely numeric format was about to exhaust. The change is forward-only — it does not renumber existing CNPJs.

How are the two check digits calculated?

Each of the first twelve characters is converted to a number with the rule value = ASCII − 48, so '0'-'9' map to 0-9 and 'A'-'Z' map to 17-42. The first check digit is a weighted sum of those twelve values with weights 5,4,3,2,9,8,7,6,5,4,3,2, taken modulo 11: remainder 0 or 1 gives 0, otherwise 11 − remainder. The second appends the first digit and repeats with weights 6,5,4,3,2,9,8,7,6,5,4,3,2. For 12ABC34501DE the digits are 35.

Do my existing numeric CNPJs change?

No. The alphanumeric format applies only to new registrations from July 2026. Every CNPJ already issued stays exactly as it is and remains valid. Because digits convert to their own value under ASCII − 48, the algorithm gives a numeric CNPJ the identical check digits it has always had — the new rules are a strict superset of the old ones.

Which letters are allowed — are I and O excluded?

For validation, the full A-Z range is accepted: a CNPJ containing I or O that satisfies módulo 11 is structurally valid, and a validator should not reject it. Separately, ENCAT recommended in Nota Técnica Conjunta 2025.001 that Receita avoid issuing the visually ambiguous letters I, O, U, Q and F. At the time of writing that is a recommendation pending confirmation, not a validation rule — so a generator of test data does well to avoid those letters, but a validator must still accept them.

Can the check digits ever be letters?

No. Only the first twelve positions (the root plus the branch identifier) can be alphanumeric. The last two positions are always numeric, because they are the output of the módulo 11 calculation, which always yields a digit 0-9. So a valid alphanumeric CNPJ matches the pattern [A-Z0-9]{12}[0-9]{2}.

Does my company need to do anything?

Your existing CNPJ does not change and needs no action. The work is in software: any system that stores, validates, or displays a CNPJ has to accept letters in the first twelve positions before it starts receiving alphanumeric IDs from new partners, suppliers, or customers after July 2026. A numeric-only validator will wrongly reject a valid alphanumeric CNPJ, which can block an onboarding, an invoice, or a payment.

How do I update my validation to accept the new format?

Three changes cover most systems: widen the database column that stores a CNPJ from a numeric type to text; replace any ^\d{14}$ regular expression with ^[A-Z0-9]{12}[0-9]{2}$; and make the check-digit routine convert characters with ASCII − 48 instead of parsing integers. The weights and the remainder rule are unchanged, so you extend one algorithm rather than maintaining two.

Is this calculator official, and is my data sent anywhere?

It is not an official Receita Federal service, but it implements exactly the algorithm Serpro and Receita published (ASCII − 48 plus módulo 11), verified against the official sample 12.ABC.345/01DE-35. It runs entirely in your browser — the twelve positions you type are never sent to a server, and nothing is stored beyond an optional list of your own recent inputs kept locally on your device.