RG Generator
Generate mathematically valid Brazilian RG (identity) numbers in the São Paulo format for software testing. For test use only.
What is an RG generator used for?
The RG (General Registry) is the identity card issued by Brazilian states. Since the format changes from state to state, here we follow the São Paulo standard (SSP/SP): 8 base digits plus 1 check digit, which may turn out to be an X.
It comes in handy when you need to populate test registrations in systems that require an RG without reaching for real people's data.
For testing and development use only.
Understanding the Brazilian RG
The RG — Registro Geral, also known as Carteira de Identidade, is Brazil's traditional identity card. Unlike the CPF (federal), the RG is issued by each state's Secretaria de Segurança Pública (SSP), so there is no single national algorithm: every state has its own numbering scheme, its own check-digit rules — and often no check digit at all. This is why a Brazilian can legally hold one RG per state and why so much fraud-prevention logic ends up reading the CPF instead.
A patchwork of formats
- São Paulo (SSP-SP) — 8 digits plus a check digit (
XX.XXX.XXX-D) computed with modulo 11 and weights 2 through 9. When the result is 10 the DV is written asX. - Paraná — 8 digits with check digit, similar modulo-11 logic.
- Minas Gerais — printed as
MG-XX.XXX.XXXwith a state prefix; the numbering pool follows internal SSP-MG rules. - Rio de Janeiro, Bahia and most other states — sequential numbering with or without a check digit; the issuing office is identified by the SSP-UF abbreviation on the card.
Legal frame: Lei nº 7.116/1983 standardized validity and design, and Decreto nº 9.278/2018 mandated higher-security models with biometric data and machine-readable zones.
The transition to CIN
In 2023 Brazil rolled out the CIN — Carteira de Identidade Nacional, which is gradually replacing the state-issued RG. The CIN uses the CPF as the single national identifier, adopts the ICAO 9303 machine-readable layout used by passports, embeds biometrics in a chip and carries an explicit expiration date (5 years for minors, 10 for adults, indefinite from age 60). The legacy RG cards remain valid until 2032, after which only CIN will be accepted.
Generate RG numbers for testing
Registration systems that ask for the RG (a Brazilian ID) need valid numbers to test with, and grabbing a real document for that isn't a good idea. This generator builds RG numbers in the São Paulo format, nine digits with a check digit, mathematically valid and belonging to no one.
Since they pass the São Paulo RG's format validation, you can use them to seed development databases, test forms and approve integrations. Worth restating the limit: this is fictitious data, made for software testing. Never for fraud, forgery or impersonating anyone.
It all comes from the browser itself, with no database lookup. Generate as many RG numbers as your test environment calls for.
Frequently asked questions
Can a Brazilian have RGs from more than one state?
Does the RG work as a passport?
Is an old RG with a decades-old photo still accepted?
Why is there no nationwide check-digit algorithm?
Can I use a generated RG to sign up for a real service?
Related Tools
CNPJ Generator
Generate mathematically valid Brazilian CNPJ numbers for software testing. With or without formatting. For test use only.
Brazilian Certificate Number Generator
Generate valid Brazilian birth, marriage or death certificate numbers for software testing. Standard 32-digit CNJ format. For test use only.
Name Generator
Generate random Brazilian names (male, female or both) for software testing and database population.
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.
Batch CPF Generator
Generate many valid Brazilian CPF numbers at once (up to 1000) to test systems, forms and sign-ups. Choose with or without mask and copy the ready list.
Company Data Generator
Generate fictitious company data (company name, CNPJ and type) for software testing. Mathematically valid CNPJ.