RG-MG Format Validator
Validate the format of a Minas Gerais RG ID (9 digits plus an alphanumeric check digit). Useful for checking documents in forms and sign-ups.
Minas Gerais RG: the MG- prefix that identifies the state on sight
The RG issued in Minas Gerais is produced by the PCMG (Polícia Civil de Minas Gerais) identification institute. Its most recognisable trait is the literal MG prefix printed in front of the number, giving the mask MG-NN.NNN.NNN (the letters MG followed by 8 digits). Because the state is baked into the string itself, an MG RG is self-labelling — you don't need a separate UF field to know where it came from. This tool validates that format/mask.
Like most Brazilian states other than São Paulo, MG does not publish a widely documented public check-digit algorithm, so the dependable, portable validation is structural: the MG prefix plus the eight-digit body in the canonical mask.
Reading MG-12.345.678
MG: the fixed state prefix (case-insensitive on input, canonically uppercase).- Hyphen: a conventional separator between the prefix and the number.
- 8 digits: the registration body, grouped
NN.NNN.NNNwith dots.
Where it shows up
- Onboarding & KYC: MG-issued IDs in banking, telecom and HR forms across the state.
- Public services: PCMG, Detran-MG and state systems reference the RG.
- Self-labelling: the
MGprefix removes ambiguity even when no separate UF field is captured. - Mock data / testing: generating mask-valid MG RGs for form QA and synthetic fixtures.
Gotchas
- Keep the prefix: stripping
MGthrows away the state marker that makes the number unambiguous. - No SP-style checksum: don't apply São Paulo's mod-11 to an MG number — there's no equivalent public spec.
- Eight digits, not nine: the MG mask here has no trailing verifying digit in the captured form.
- CIN transition: new MG identity cards are CPF-keyed under the national CIN; the legacy MG RG stays valid.
FAQ
Why does the MG RG start with letters? The MG prefix encodes the issuing state directly in the number, so it identifies itself without a separate UF field.
Does MG have a check digit? There is no widely documented public algorithm like São Paulo's; format validation is the practical standard.
Is an MG RG valid in other states? It is a national identity document, but the number is issued by and scoped to Minas Gerais — pair it with its issuer (PCMG) in records.
Related Tools
PIS Format Validator
Validate a Brazilian PIS/PASEP number (11 digits) by checking its verification digit with the official algorithm. Useful for HR and payroll records.
RG-SP Format Validator
Validate the format of a São Paulo RG ID (8-9 digits plus check digit, including X). Useful for checking documents in forms and sign-ups.
CBO Format Validator
Validate the format of a Brazilian CBO code (Classification of Occupations, 6 digits). Useful for HR, payroll, eSocial and employee registration.
Canada SIN Format Validator
Validate the format of a Canadian SIN (Social Insurance Number) in the 3-3-3 digit pattern. Useful for forms, sign-ups and data validation in Canada.
US Passport Format Validator
Validate the format of a US passport number (9 alphanumeric characters). Useful for travel forms, bookings and international sign-ups.
ICD-10 Code Format Validator
Validate ICD-10 code format (letter + 2 digits + optional dot + 1-4 alphanum).