RG generator and validator

Generate valid RGs to use in tests or check whether an RG is valid.

What do you want to do?

A valid RG is generated when the page opens. Choose the quantity and the format, or click "Generate RG" to create another one.

Options

How it works

  • The RG is generated on the server and is not stored anywhere.
  • Each state issues the RG its own way, so the generator follows the São Paulo rule, the one most systems use: 8 digits and a check digit.
  • The check digit can be an X, which stands for 10.
  • The number is for testing only and does not belong to any real person.
  • The latest generated values are listed below the button until you leave the page.

How to use the API

You can integrate the RG generator into your app through our REST API.

Endpoint

GET /api/generators/rg

Query parameters

quantity
Optional. From 1 to 50. When set, the response has the "rgs" list instead of "rg".
formatted
Optional. "false" generates it without punctuation. Default: "true".

curl example

curl "https://devtools.vmotta.dev/api/generators/rg?quantity=2&formatted=false"

Response

{
  "rgs": [
    "905566610",
    "39541250X"
  ]
}