1001Ferramentas
🪪 Generators

Fake Brazilian RG by State

Generates RG numbers following the visual format of each Brazilian state (SP, MG, RJ, RS…) for testing — fictional, no legal validity.

Atenção: os RGs gerados são fictícios. Servem apenas para popular bases de teste — não use em documentos reais.

Why an RG generator by state?

Brazil never had a single national identity-card algorithm. Each Secretaria de Segurança Pública (SSP) — and in some states the IGP or IIRGD — designed its own format, length and check-digit rule. That is why a per-UF generator is not a gimmick: the only way to populate realistic test fixtures for a multi-state CRM, a Detran integration sandbox or a frontend mask is to emit numbers that match the actual issuing office. Picking SP here gives you the eight-digit SSP-SP layout with the famous mod-11 check digit; picking MG gives you the MG-XX.XXX.XXX prefix, and so on.

Format quirks by UF

  • SP (SSP-SP, historically IIRGD)XX.XXX.XXX-D: 8 digits plus 1 DV, mod 11 with weights 2–9, DV rendered as X when the result is 10.
  • RJ (DETRAN-RJ, previously IFP) — 8 digits plus 1 DV; same mod-11 family but different weight order.
  • MGMG-XX.XXX.XXX: 2-letter state prefix plus 7 digits; pool managed by SSP-MG.
  • PR (SESP-PR) — 8 digits plus DV.
  • RS (IGP-RS) — 10 digits, no separator.
  • BA — 9 digits plus DV; GO / DF (PCDF) follow similar patterns.

The "one RG per UF" anomaly

Because the SSPs operated in isolation, a Brazilian could legally hold one RG in São Paulo, another in Bahia and another in Rio Grande do Sul, with completely different numbers and photos. The legacy of Lei nº 7.116/1983 standardized layout but not numbering, and that gap is exactly what the new CIN — Carteira de Identidade Nacional closes: from 2023 onward CIN uses the CPF as the single national identifier, embeds biometrics in a polycarbonate chip card (instead of the old PVC laminate) and adopts the ICAO 9303 machine-readable zone. Legacy RG cards remain valid until 2032; after that only CIN is accepted. The defunct "RG-Mercosul" intermediate model is being absorbed into CIN as well.

When to use a per-UF generator

  • Detran / SSP sandbox integrations — services that branch on UF need every variant covered.
  • Frontend masks and validators — make sure your input mask switches between XX.XXX.XXX-X, MG-XX.XXX.XXX and pure numeric formats.
  • CRM seeding — to test the "duplicate person across states" deduplication logic that CIN was designed to fix.
  • Document-extraction OCR — train regex pipelines against every legitimate UF layout.

FAQ

Can I use a generated RG in a real form? No. The number is structurally plausible but not registered with any SSP. Submitting it to a real service is identity fraud — Brazilian Penal Code arts. 299 (false ideology) and 307 (false identity).

Does this generator validate every state's DV? Only SP, RJ and PR have a publicly documented mod-11 check digit. Many "validate any RG" libraries silently apply the SP rule everywhere — which is why a per-UF generator is more honest: it emits the shape, not a guaranteed DV.

Will CIN replace RG? Yes, gradually. Issuance started in 2023 and the 2032 deadline ends acceptance of legacy state RGs. New issuances are already CIN by default in every UF.

Why is São Paulo's check digit sometimes the letter X? Because 10 is not a single digit. The SSP-SP convention writes X in that slot (Roman ten), the same trick used by ISBN-10.

Is it safe for multi-state test data? Yes — that is the whole point. Pick each UF in turn, generate a batch and load the CSV into your CRM or Detran client.

Related Tools