Axon Toolbox

Free telecom & identity tools

Free tool

Brazil RG Generator & Validator (São Paulo)

Generate valid test RG numbers (Registro Geral) — the state-issued identity card number — using the São Paulo SSP-SP check-digit rule, or paste an RG to check its digit. Other states run their own, unpublished schemes and are not covered here.

RG Generator

The eight-digit registration number is random; the check digit is calculated with São Paulo's SSP-SP weighted modulo-11 formula.

Flag of Brazil

Brazil · 9 characters

Only São Paulo publishes its check-digit rule

1 – 100

RG Validator (São Paulo)

Paste a 9-character São Paulo RG, with or without punctuation, to check its check digit. This only checks the SSP-SP formula — an RG from another state can fail here and still be genuine.

Every RG this tool produces is synthetic test data only. It is not issued by any Secretaria de Segurança Pública and does not belong to any real person. Use it on your own test systems only — never on a real form, registration or KYC check.

How a São Paulo RG number is structured

A São Paulo RG is nine characters: an eight-digit registration number and one check digit. Taking 24.678.131-2 as an example:

The segments of a 9-character São Paulo RG
DigitsSegmentMeaning
24678131Registration numberEight sequential digits issued by SSP-SP.
2Check digitWeighted sum with weights 2 3 4 5 6 7 8 9 over the eight digits, then 11 minus the remainder modulo 11; a result of 11 is written 0 and 10 is written X.

RG is a state-issued document: each state's own Secretaria de Segurança Pública (SSP) runs its own numbering and its own check-digit rule, and most of those rules are not published. São Paulo's SSP-SP formula above is the one that is publicly documented, which is why this tool is limited to it.

The national identity card that has been rolling out since 2022, the CIN (Carteira de Identidade Nacional), replaces the patchwork of state RG numbers with a single document — but rather than mint a new number of its own, it prints the holder's CPF as the document number, so RG is gradually being superseded rather than reissued.

Why generate test RG numbers?

Onboarding forms and document-capture flows in Brazil often ask for an RG alongside a CPF, particularly for older accounts and physical-document verification. Testing those flows needs input that looks and checks out like a real RG.

Using a real person's RG in a test environment is a privacy problem under LGPD, since an RG is personal data tied to a named individual. Synthetic numbers that pass the SSP-SP checksum let you exercise format checks and validation logic without any real identity document data leaving production.

Frequently asked questions

What is an RG?
RG (Registro Geral) is the identity card number issued by a Brazilian state, not by the federal government. It appears on the physical identity card most Brazilians carry alongside — or in place of — a CPF, and is commonly asked for on forms, in stores and at check-in counters.
Why does this tool only cover São Paulo?
Each state runs its own Secretaria de Segurança Pública (SSP) and its own numbering scheme, and most states do not publish their check-digit formula. São Paulo's SSP-SP rule is the one that is publicly documented, so it is the only state this tool can generate or validate against with any confidence.
Why does the check digit use the letter X?
The São Paulo formula is a weighted sum over the eight registration digits (weights 2 through 9), reduced modulo 11. A remainder of 11 is written as 0, but a remainder of 10 cannot be written as a single digit — by convention it is written as the letter X, the same trick used on the last digit of an ISBN.
RG vs CPF vs CIN — what is the difference?
CPF is a federal tax-registry number for individuals, issued once and used nationwide for almost everything financial. RG is a state-issued identity-card number with no national formula. CIN (Carteira de Identidade Nacional), rolling out from 2022, is the new national identity card — but instead of inventing a third number, it prints the person's CPF as the document number, effectively retiring RG as a distinct identifier over time.
Are these real RG numbers?
No. Every RG this tool produces is randomly generated test data that passes the São Paulo SSP-SP checksum. It is not issued by any Secretaria de Segurança Pública and does not belong to any real person.
Why might the validator reject a real RG?
If the number was issued by a state other than São Paulo, it follows that state's own — undocumented — formula, not the SSP-SP one this tool checks. The validator will report the check digit as wrong even though the RG is entirely genuine; a failure here only means "not a valid São Paulo RG", not "not a valid RG".
Why would I need generated RG numbers?
To test onboarding forms and document-capture flows that accept an RG alongside a CPF, without keying in a real person's state identity number. Synthetic numbers exercise the same format and checksum logic while keeping real personal data — protected under LGPD — out of test and staging systems.