Validator of Latvia Personas Kods
Latvian personal identification code (PMLP) with weighted Modulo 11.
About Latvian Personas Kods
The Personas Kods is the unique civil identity code assigned by the PMLP to citizens, non-citizens, and registered residents of Latvia.
On July 1, 2017, Latvia introduced an alternative non-significant format starting with '32' to protect individual privacy by omitting birthdates.
Anatomy & Structure of Latvian Personas Kods
The Latvian Personas Kods consists of 11 digits (classic DDMMYY-SCCSC or post-2017 32XXXXXXXXX):
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 to 6 | Birth Date or Prefix | 6 digits | Day, month, and year (DDMMYY) or '32' prefix for modern format | 010110 |
| 7 | Century Indicator | 1 digit | 0 (19th c.), 1 (20th c.), 2 (21st c.) in classic format | 1 |
| 8 to 10 | Registry Sequence | 3 digits | Sequential number issued by PMLP | 234 |
| 11 | Check Digit | 1 digit | Weighted Modulo 11 verification checksum | 4 |
Official PMLP Algorithm (Weighted Modulo 11)
Verification formula applied to the first 10 digits:
C = 1 - (Σ (d[i] * w[i]) mod 11); if C < -1 then C = C + 11
- 1. Multiply the first 10 digits by weights [1, 6, 3, 7, 9, 10, 5, 8, 4, 2].
- 2. Calculate the weighted sum and find remainder modulo 11.
- 3. Subtract remainder from 1 (C = 1 - remainder). If C < -1, add 11.
- 4. If result equals 10 or -1, the code is invalid/discarded by PMLP.
- 5. Verify match with the 11th digit.