The Latvian personas kods (personal code) is an 11-digit identifier from the PMLP. Codes issued before July 2017 embed the date of birth (DDMMYY) and end with a mod-11 check digit; codes issued since then begin with 32 and carry no date or published checksum. This tool validates both variants in your browser.
How it works
After removing the optional dash, the validator looks at the first two digits:
- New 32-series code: if the code starts with
32, it is a post-2017 code with no birth date. The tool checks only that it is 11 digits beginning with32. - Old date-based code: otherwise, the first six digits are treated as
DDMMYY. The tool runs the official mod-11 check-digit algorithm:
weights = [1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
sum = Σ digit[i] × weights[i] for i = 0..9
C = (1101 − sum) mod 11 mod 10
valid = C equals digit[10]
It also performs a light plausibility check on the embedded date (day 1–31, month 1–12) and reports it, though the checksum is the authoritative test.
Old format structure
For codes issued before July 2017, each position has a defined meaning:
DD MM YY - C NNN K
│ │ │ │ │ └── check digit (positions [10])
│ │ │ │ └────── sequence number within the birth-date group (NNN)
│ │ │ └──────── century marker (0 or 1 for 1800s, 2 for 1900s, 3/4 for 2000s)
│ │ └───────────── last two digits of birth year
│ └──────────────── birth month (01–12)
└─────────────────── birth day (01–31)
The century marker digit (position 7, just after the dash) encodes the birth century: 0 or 1 for persons born in the 1800s, 2 for 1900s, and the pattern continues into the 2000s. This lets the six-digit date part unambiguously represent dates across centuries.
The three-digit sequence (positions 8–10 before the check digit) was used to distinguish individuals born on the same date. Importantly, it also encoded sex: odd sequence numbers were assigned to males, even to females.
Why Latvia moved to 32-series codes
Latvia’s new privacy-respecting format, introduced from July 2017, removes birth-date encoding entirely. The change was driven by EU data minimisation principles under the GDPR predecessor framework — there is no reason a social number used for administrative reference needs to expose the holder’s date of birth and sex to anyone who reads it. The 32-prefix codes are opaque: they carry no inferrable personal attributes.
For existing holders, old codes remain in use alongside new ones. Latvian authorities accept both formats. IT systems handling Latvian identity data therefore need to handle both the mod-11 checksum path (old codes) and the format-only validation path (new codes).
Example
Old code: 161175-19997 → date 16-11-1975, check digit recomputed and compared
New code: 320123-45678 → begins with 32 → format-only validation, no check digit
Notes
A valid result confirms the code is internally consistent (old) or correctly structured (new). It does not confirm the code was issued or belongs to a real person — only the PMLP register can. All processing is local, so the tool is safe for KYC and HR pre-checks where you need to catch typographic errors before submitting to an official system.