RG Validator

Quickly and easily validate your RG! Our RG validator ensures the authenticity of the provided number, confirming that it is valid and error-free. If you need to generate a new RG, try our RG generator.

This tool generates fictitious data intended exclusively for software testing and development purposes. The data does not correspond to real people or entities and must not be used for illegal, fraudulent purposes, or in ways that violate the privacy of others. Compliant with LGPD (Brazilian Data Protection Law).

How RG Validation Works

What does the validator check?

The Help4Dev RG validator checks the consistency of the check digit for RGs in the SSP-SP (São Paulo) standard. The São Paulo RG has 8 base digits and 1 verifier (which may be a digit or the letter X). The validator calculates the expected verifier using weights from 2 to 9 and modulus 11, and compares it with the provided verifier. There is no query to Public Security Secretariat databases.

When is an RG considered invalid?

An SSP-SP RG is invalid when: (1) it does not have 8 base digits plus the verifier; (2) the check digit does not match the expected calculation by the algorithm. Verifier X is valid when the calculation results in 1. RGs from other states have different formats and algorithms and may not be correctly validated by this verifier, which is optimized for the SSP-SP standard.

Why validate RG in development?

Individual registration systems on health, legal, financial, and government platforms frequently include RG as an optional or mandatory field. Testing the validation logic of these systems requires both valid and invalid RGs. The Help4Dev validator is useful for quickly checking whether a specific number is valid by the SSP-SP standard during development.