RG Validator

Type an RG number and see right away whether the check digit matches. The math applies to the São Paulo format: 8 digits plus a check digit, which can be X.

Valid RG

Need an RG to test with?

Generate RG

What the RG Validator checks

The RG has no single national number like the CPF. Each state issues its own, and only the São Paulo format has a check digit rule you can verify yourself: 8 digits followed by a digit that runs from 0 to 9 or is the letter X.

This page recalculates that digit from the first 8 digits and compares it with what you typed. The RG Generator uses the same rule, so everything it produces passes here.

What about RGs from other states?

They cannot be validated from the number alone, for three reasons:

  • Each state public security department sets its own format, with different lengths and letters.
  • Many states do not publish a check digit rule, so there is no calculation to redo.
  • The same number can exist in different states, for different people.

An RG from another state can pass or fail here by chance, and that says nothing about the document. Only the issuing agency can confirm that an RG exists.

How the check digit is calculated

The calculation uses the first 8 digits:

  1. Multiply the 8 digits by 9, 8, 7, 6, 5, 4, 3 and 2, from left to right.
  2. Add up the results.
  3. Divide the sum by 11 and keep the remainder.
  4. The remainder is the check digit. If it is 10, the digit is X.

Example: for 12.345.678 the sum is 156, the remainder is 2 and the RG becomes 12.345.678-2.

What it is for

  • Testing a form's RG field with numbers that should pass and numbers that should fail.
  • Checking that an RG generated for testing has the right digit.
  • Spotting typos in a list of São Paulo RGs, such as a swapped digit.

RG Validator FAQ

What the RG check covers and what it cannot tell you.