Brazilian State Tax ID Generator
Generate valid Brazilian State Tax IDs (Inscrição Estadual) for SP, RJ, MG, RS, PR and BA. For fiscal software and SEFAZ integration testing.
What is the State Tax ID?
When a company pays ICMS, it has to be registered with its state's Tax Authority. That registration is the State Tax ID (Inscrição Estadual). Worth noting that the format and verification algorithm differ from one state to another.
Here you can generate IDs for SP, RJ, MG, RS, PR and BA. It tends to come in handy for SEFAZ integration tests and when you need to validate tax forms.
For testing and development use only.
How Brazilian state tax IDs (Inscrição Estadual) work
The Inscrição Estadual (IE) is the state-level tax registration number assigned to any business that sells goods subject to ICMS — Brazil's value-added tax on circulation of merchandise. Unlike the federal CNPJ, which is a single national format, each of the 26 states plus the Federal District designs its own IE layout, check-digit algorithm and weight scheme. That gives 27 different algorithms, each maintained by the local Secretaria de Fazenda (SEFAZ).
A typical algorithm takes a sequence of base digits, multiplies them by a vector of weights, sums the products, divides by 11 and derives the check digit from the remainder. The differences live in the details: the number of base digits, the weight vector (sometimes ascending, sometimes descending, sometimes mixed), how the modulo 11 result is mapped to a digit (often 11 - rem, but some states substitute 0 or 1 in edge cases), and whether the layout contains a dot/slash mask. Some states (e.g. PE, RN) also have a long format for special taxpayers.
Formats by state
- SP: 12 digits + 2 DV. DV1 = mod 11 of the first 8 digits × weights 1,3,4,5,6,7,8,10. DV2 = mod 11 of the first 11 × weights 3,2,10,9,8,7,6,5,4,3,2. Rural producers use
P+ 11 digits. - RJ: 8 digits + 1 DV (mod 11).
- MG: 13 digits + 2 DV. A specific algorithm inserts a zero in the 4th position before computing DV1.
- DF: 13 digits + 2 DV, written as
XX.XXX.XXX/XXX-XX. - PR: 10 digits + 2 DV.
- RS: 10 digits + 1 DV.
- 9-digit, 1-DV states: AL, AM, AP, CE, ES, GO, MA, MS, PA, PB, PE (short form), PI, RR, SC, SE.
- Others: AC 13d/2DV, BA 8 or 9d/2DV, MT 11d/1DV, PE 14d (long form), RN 9 or 10d/1DV, RO 14d/1DV, TO 11d/1DV.
Where the IE is used
The IE appears on every NF-e (electronic invoice), on SPED Fiscal and SPED Contribuições filings, on the company's SEFAZ taxpayer registry and on inter-state freight documents (CT-e, MDF-e). National lookup of any IE is available through Sintegra (Sistema Integrado de Informações sobre Operações Interestaduais com Mercadorias e Serviços) at sintegra.gov.br, which redirects to the state portals.
FAQ
Can a taxpayer be exempt from the IE? Yes. Several states grant an isento status (typically MEIs, service-only providers and certain rural producers). Some ERPs accept the literal string ISENTO in the IE field.
Is the IE unique to the company or to the establishment? Per establishment. The head office and each branch have their own IE, even when they share the same CNPJ root.
Why does the rural-producer SP IE start with a P? Because state law treats rural producers as a distinct contributor class, with its own register that prefixes the number with the letter P followed by 11 digits.
Can I use a generated IE on an NF-e? No. SEFAZ rejects any IE that is not in the state's active taxpayer registry — the algorithm passing is not enough. The generator is for unit tests, integrations, mock data and software demos.
State Registration generator for testing
The State Registration (Inscrição Estadual) is a company's registration with the state tax authority. Every Brazilian state follows its own format and check-digit rules, so producing a valid number by hand is a real chore. This generator builds valid State Registrations for the main states, ready for you to use in testing.
It covers SP, RJ, MG, RS, PR and BA, and for each one it applies the matching algorithm so the numbers pass that state's validation. It works well for testing fiscal systems, invoice issuers and tax integrations without touching real companies' data. Worth stressing: everything here is fictitious, meant only for software testing.
Generation happens inside your browser, with no lookup against any database. Pick the state and produce as many registrations as your fiscal test environment calls for.
Related Tools
CNPJ Generator
Generate mathematically valid Brazilian CNPJ numbers for software testing. With or without formatting. For test use only.
RENAVAM Generator
Generate mathematically valid Brazilian RENAVAM vehicle registration numbers for automotive software testing. Correct check digit. For test use only.
Credit Card Number Generator
Generate valid credit card numbers using the Luhn algorithm for e-commerce and payment testing. Supports Visa, MasterCard and Elo. For test use only.