Test data for Brazilian software
EN
Fictitious data for software testing. Using fake documents for fraud is a crime in Brazil (Penal Code, arts. 297–299, 307).

Inscrição Estadual (IE) generator and validator — 27 states

The Inscrição Estadual (IE) is a company’s state-level tax registration for ICMS, Brazil’s state VAT-like tax. Generate fictitious IEs for any state with check digits computed by each state’s published rule, and bulk-validate test customer and supplier lists.

—

Up to 1000 items at once. Everything is generated in your browser.

How to use

  1. Pick a State (UF) or leave it on Any, and tick With mask (punctuation) to get the state’s own format.
  2. Click Generate, then Copy.
  3. For NF-e or B2B fixtures, set the Quantity (1–1000) and use Export CSV, Export JSON or Export SQL.
  4. On the Validate tab, paste one IE per line. Put the state code first to check against that state, e.g. SP 110.042.490.114; a bare number is tested against all 27 states.
  5. Each line shows valid (plus the matching states) or the reason: length, characters, repeated digits, prefix not used in that state, or check digit.

How it works

What the IE is

Every company that pays ICMS is registered with the finance secretariat (SEFAZ) of its state and receives an IE. There is no national format: each of the 26 states and the Federal District sets its own length, prefixes and check-digit (DV) rule. The official rules are collected as “roteiros de crítica” on the SINTEGRA portal, which is what this tool implements. In the table, m11 means: weights 2, 3, 4… from right to left, sum mod 11; a remainder of 0 or 1 gives DV 0, otherwise DV = 11 − remainder.

StateDigitsMaskMethod
AC13##.###.###/###-##starts with 01; 2 m11 check digits (weights 4,3,2,9…2 and 5,4,3,2,9…2)
AL9#########starts with 24 + type 0/3/5/7/8; DV = (Σ×10) mod 11, 10 → 0
AP9#########starts with 03; DV = 11 − ((p + Σ) mod 11), p and d set by number range
AM9##.###.###-#m11; if Σ < 11, DV = 11 − Σ
BA8 / 9######-## · #######-##2 DVs; mod 10 or mod 11 depending on the 1st (8 digits) or 2nd (9 digits) digit; 2nd DV computed first
CE9########-#m11
DF13###########-##starts with 07 or 08; 2 m11 DVs
ES9###.###.##-#m11
GO9##.###.###-#starts with 10, 11 or 20–29; m11 + exception range
MA9#########starts with 12; m11
MG13###.###.###/####municipality + number + branch; DV1 mod 10 (weights 1/2), DV2 m11 (weights 3,2,11…2)
MS9#########starts with 28 or 50; m11
MT11##########-#left-padded with zeros; weights 3,2,9…2
PA9##-######-#starts with 15 or 75–79; m11
PB9########-#m11
PE9 / 14#######-## · ##.#.###.#######-#eFisco: 2 m11 DVs; CACEPE (14): 1 DV, weights 5…1,9…2
PI9#########m11
PR10###.#####-##2 m11 DVs, weights 2…7
RJ8##.###.##-#weights 2,7,6,5,4,3,2; m11
RN9 / 10##.###.###-# · ##.#.###.###-#starts with 20; DV = (Σ×10) mod 11, 10 → 0
RO9 / 14###.#####-# · #############-#pre-2000: municipality + 5 digits; current: 13 digits + DV; DV = 11 − r (≥ 10 → −10)
RR9########-#starts with 24; DV = Σ(position × digit) mod 9
RS10###/#######municipality + 6 digits; weights 2,9…2
SC9###.###.###m11
SE9########-#m11
SP12 / 13 (P)###.###.###.### · P-########.#/###DVs in positions 9 and 12: last digit of (Σ mod 11); rural producers start with P
TO9 / 11##.###.###-# · ##.##.######-#type 01/02/03/99 in positions 3–4, left out of the sum; m11

Worked example: SP 110.042.490.114

This is the example from São Paulo’s own rule page. The IE has 12 digits; the 9th and 12th are check digits.

  1. First DV (position 9): the first 8 digits 1 1 0 0 4 2 4 9 take the weights 1, 3, 4, 5, 6, 7, 8, 10: 1 + 3 + 0 + 0 + 24 + 14 + 32 + 90 = 164. 164 mod 11 = 10; the DV is the rightmost digit of the remainder: 0.
  2. Second DV (position 12): the 11 digits 1 1 0 0 4 2 4 9 0 1 1 take the weights 3, 2, 10, 9, 8, 7, 6, 5, 4, 3, 2: 3 + 2 + 0 + 0 + 32 + 14 + 24 + 45 + 0 + 3 + 2 = 125. 125 mod 11 = 4.

Result: 110.042.490.114.

Special formats

  • SP rural producer: P-0MMMSSSS.D/NNN, 13 characters; the DV covers the 8 digits after the P with the first-DV weights, and the last 3 digits are not part of the calculation (e.g. P-01100424.3/002).
  • MG: the first 3 digits are the municipality code. For DV1 a 0 is inserted after them, digits are multiplied alternately by 1 and 2, the digits of the products are added and the DV completes the sum to the next multiple of 10.
  • BA: look at the 1st digit (8-digit IE) or the 2nd (9-digit IE). If it is 6, 7 or 9, mod 11 applies; otherwise mod 10.
  • RO: numbers issued before 2000 had a 3-digit municipality + 5 digits + DV (only the 5 are summed); the current format has 14 digits.
  • PE: eFisco uses 9 digits with two DVs; the older CACEPE uses 14 digits with one. Both are accepted.
  • TO: positions 3–4 hold a type code (01 rural producer, 02 industry and trade, 03 small informal businesses, 99 old suspended register). The 9-digit form without a type is accepted too.
  • RR: the DV is the sum of each digit times its position (1 to 8), mod 9.
  • GO: for bases 10103105–10119997, remainder 1 gives DV 1. This exception is not on the current SINTEGRA page but is kept by widely used validators.

FAQ

Does a valid result mean the company is registered?

No. The tool only checks length, prefix and check digits against each state’s rule. Registration status (active, suspended, cancelled) can only be looked up in the state SEFAZ services or the national taxpayer registry query, none of which are contacted here.

Why does a bare number match several states?

Many states use 9 digits and the same mod 11 rule, so one number can satisfy more than one of them. That is why validation without a state code lists every matching state. If you know the state, type its code first, as in SP 110.042.490.114, for an exact check.

Can I use these IEs on real invoices?

No. They are fictitious and meant for automated tests, the NF-e homologation (staging) environment, database seeds and demos. Issuing tax documents or registering real suppliers with them is improper and may amount to fraud.

How should I store an IE in a database?

As text, never as an integer: leading zeros matter (MT, RO, PE) and SP rural producer numbers start with the letter P. Store it unmasked with the state in a separate column, and add punctuation only for display.

What about buyers that have no IE?

When the recipient has no state registration, the NF-e says so in the indIEDest indicator (2 = exempt contributor, 9 = non-contributor), as described in the NF-e manual; older layouts used the word ISENTO. Neither is a number and does not go through this validator; handle it in your application logic.

Sources

Related tools

Updated 2026-11-13 · Rafael Lima