The Sri Lanka NIC Validator checks whether a National Identity Card number is structurally valid in either the old 9-character format or the new 12-digit format, and decodes the birth year, day-of-year serial, and encoded sex it carries — all locally in your browser.
How it works
Two NIC formats are in circulation. The old format is nine digits followed by
the letter V or X: the first two digits are the last two digits of the birth
year (prefixed with 19), digits three to five are a day-of-year serial, and the
remaining digits form a serial. The new format is twelve digits: the first four
are the full birth year and digits five to seven are the day-of-year serial.
Sex is encoded in the day-of-year block. For males the block is 1 to 366; for females 500 is added, giving 501 to 866. The tool subtracts that offset to recover both the calendar day and the holder’s sex, then validates that the decoded day falls within 1 to 366 and that the birth year is plausible.
Example
The old NIC 857654321V decodes to a 1985 birth year and a male holder (the
day-of-year block is below 500). The new NIC 198512345678 decodes to a 1985
birth year, with the day-of-year serial and sex read from digits five to seven.
Notes
Decoding confirms the number is internally consistent and reveals the encoded birth year and sex, but it does not prove the card was issued or is currently valid. The Department for Registration of Persons holds the authoritative record. Everything runs locally in your browser.