Skip to main content

Voter ID Validator

Validate Brazilian Voter ID numbers quickly and securely. For testing.

About the Voter ID Validator

The Voter ID Validator checks if a number follows the official algorithm of the Superior Electoral Court (TSE). The Voter ID has 12 digits: 8 sequential, 2 for state code, and 2 verification digits.

Ideal for developers who need to validate the Voter ID format in registration systems. The validation is mathematical and does not query the TSE database.

Anatomy & Structure of Brazilian Voter ID

The Voter Registration card contains 12 decimal digits in 3 segments:

PositionFieldLengthMeaning & RuleExample
1 to 8Sequential Number8 digitsSequential voter identity registration number04399701
9 & 10State Code (UF)2 digitsState code (01 for SP, 02 for MG up to 28 for TO and 29 abroad)01
11 & 12Check Digits2 digitsDual Modulo 11 check digits with specific TSE remainder rules59

Official Voter ID Algorithm (TSE Modulo 11)

The Electoral Court calculates check digits taking into account the state code and remainders 0 and 10:

CD1 = (Sum1 % 11); CD2 = ((d[8]*7 + d[9]*8 + CD1*9) % 11)
  1. 1. Multiply first 8 digits by weights 2 to 9.
  2. 2. Evaluate remainder modulo 11.
  3. 3. If remainder is 10, CD1 is 0. If 0 and state is 01 (SP) or 02 (MG), CD1 is 1; else 0.
  4. 4. Multiply state digits by 7 and 8, and CD1 by 9.
  5. 5. Evaluate remainder modulo 11 with same state 01/02 rule.
  6. 6. Compare with digits 11 and 12.

Frequently Asked Questions (FAQ)