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.
FAQ
Can a Brazilian have RGs from more than one state? Historically yes, since each SSP issued independently. The CIN closes that loophole by tying every record to the CPF — so once issued in one state, requests in another are flagged.
Does the RG work as a passport? Only the new CIN (and to a lesser extent the modern RG with ICAO data) is accepted as travel document for Mercosul countries and the Andean Community. For all other destinations a Brazilian passport is required.
Is an old RG with a decades-old photo still accepted? By law the RG never expires, but in practice banks, airlines and the TSE often refuse cards where the photo no longer resembles the holder — typically anything older than 10 years. The CIN expiration rules fix that ambiguity.
Why is there no nationwide check-digit algorithm? Because each state's SSP designed its own numbering before any federal coordination existed. Any tool that claims to "validate any RG" is at best validating the São Paulo format.
Can I use a generated RG to sign up for a real service? No. These numbers follow plausible state formats but are not registered with any SSP. Using them on real transactions is identity fraud (Código Penal arts. 299 and 307). The tool is intended for tests, mocks and form-validation development.
Related Tools
Handwriting Generator
Convert typed text into an image with handwriting appearance. Useful for adding a personal touch to digital work.
Resume Generator
Fill a simple printable A4 CV from a form with personal data, education and experience.
Favicon Generator
Generate a favicon from text/emoji in all common sizes (16, 32, 48, 64, 192, 512). PNG download.
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.