Latvia Personal Code Validator (Personas Kods)
Paste Latvian personal codes to check the old format's check digit and birth date, and recognise the new anonymous codes that start with 32.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Paste the codes
One personas kods per line.
- 2See the format
The tool tells old codes from new 32 codes.
- 3Read birth dates
Old codes show the date of birth.
- 4Fix old codes
Use the expected check digit for failures.
- 5Export
Download the results as CSV.
About this tool
Latvia has two formats of personal code (personas kods). Codes issued until 30 June 2017 have the form DDMMYY-CNNNC: the date of birth, a century digit (0 for the 1800s, 1 for the 1900s, 2 for the 2000s), a serial and a check digit. Since 1 July 2017, new codes start with 32 and carry no information about the person; people with old codes could request a new one. Many systems built before 2017 still try to read a date of birth from every code and reject the new ones. This validator handles both formats.
Who this is for
Developers, HR and payroll staff, banks and public services handling Latvian identity codes.
The old format
- DDMMYY: date of birth. - C: century, 0 for 1800-1899, 1 for 1900-1999, 2 for 2000-2099. - NNN: serial. - Last digit: check digit.
The check digit is calculated as (1101 minus the weighted sum of the first ten digits with weights 1, 6, 3, 7, 9, 10, 5, 8, 4, 2) modulo 11. For 161175-1999, the check digit is 7: 161175-19997 belongs to someone born on 16 November 1975.
The new format
New codes have eleven digits, start with 32 and contain no date of birth or other personal data. They are written as 32XXXX-XXXXX. The validator recognises them by the prefix and checks only the length, as the official format does not let you derive anything else.
Why it matters
Systems that compute age from the personal code fail for new codes, and systems that reject codes without a valid date block people from services. When building forms, accept both formats, and ask for the date of birth separately if you need it.
Privacy
Old codes reveal date of birth; all codes are personal data. Latvian law encouraged the new format partly for privacy. This tool works locally.
Batch use
Paste one code per line, with or without the hyphen. Each line shows the format, and old codes show the date of birth or the reason for failure. Export as CSV.
Worked example
161175-19997 is a valid old code (born 16 November 1975). 321010-25036 is a new-format code that carries no date of birth.
Forms and software
When a form asks for a personal code, accept both formats and do not compute age or sex from it. If you need the date of birth, ask for it in a separate field.
Limits
The tool does not confirm that a code was issued. The Population Register is the authority.
Worked example
161175-19997 is a valid old-format code (born 16 November 1975); 321010-25036 is a new-format code without a birth date.
Quick facts
- Category: Legal & Government
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in English.
- Content last reviewed:
- Official source: Office of Citizenship and Migration Affairs (PMLP): old personal code DDMMYY-CNNNN with a check digit, and new codes since 1 July 2017 starting with 32 without date of birth
Frequently asked questions
What are the two formats of Latvian personal codes?
Old codes with the date of birth (until June 2017) and new anonymous codes starting with 32.
How is the old check digit calculated?
As (1101 minus the weighted sum of the first ten digits) modulo 11, with weights 1, 6, 3, 7, 9, 10, 5, 8, 4, 2.
Can I read the date of birth from a new code?
No. New codes contain no personal information.
Can people change to a new code?
Yes, people with old codes could apply for a new-format code.
What does the seventh digit mean in old codes?
The century of birth: 0, 1 or 2.
Are the codes uploaded?
No. They are checked in your browser.
