1001Ferramentas
🆔Validators

RG-SP Format Validator

Validate São Paulo RG format (8-9 digits + check digit).

São Paulo RG: the one state RG with a documented mod-11 check digit

The RG issued in São Paulo comes from the IIRGD (Instituto de Identificação Ricardo Gumbleton Daunt), the SSP-SP identification institute. Its layout is 8 base digits plus a verifying digit, written NN.NNN.NNN-D. SP is notable because, unlike most states, it uses a well-documented mod-11 check digit — and that digit can be the letter X when its value is 10. This tool validates the SP format/mask; the algorithm below is what a full validator would additionally compute.

The SP mod-11 algorithm

  • Weights: multiply the 8 digits by 2,3,4,5,6,7,8,9 (left to right).
  • Sum & mod 11: add the products, take the remainder modulo 11.
  • Check digit: (11 − remainder) mod 11; a result of 10 is written X, and 11 becomes 0.
  • Example: this is why SP RGs legitimately end in X while a CPF never does.

Where it shows up

  • Onboarding & KYC: SP-issued IDs in banking, telecom and HR forms.
  • Public services: Poupatempo, Detran-SP and state systems key off the RG.
  • Document pairing: official records cite it as RG 12.345.678-9 SSP/SP.
  • Mock data / testing: generating mask-valid SP RGs for form QA and synthetic fixtures.

Gotchas

  • Format vs full check: this page validates the mask; the mod-11 digit is the extra layer for a strict SP validator.
  • The X is real, uppercase, last: never strip it as if it were noise — it carries the value 10.
  • Not portable to other states: the SP algorithm does not validate an RG issued by RJ, MG, etc.
  • Migrating to CIN: new São Paulo identity cards are CPF-keyed under the national CIN; the legacy RG number stays valid.

FAQ

Why can an SP RG end in X? Its mod-11 check digit can equal 10, which is written as the Roman numeral X to fit one character — exactly like ISBN-10.

Is the SP check digit the same as the CPF's? No. The CPF uses two mod-11 digits with different weights; the SP RG uses a single mod-11 digit over 8 digits.

Does this validator compute the check digit? It checks the SP mask. Use the algorithm above if you need to also verify the mod-11 digit.

Related Tools