Sri Lanka NIC Number Decoder
Enter a National Identity Card number in either format to read the date of birth, age, and recorded gender it encodes, and to see the same number written in the other format. Nothing is uploaded - the number is decoded in your browser and never leaves the page.
Everything is worked out in your browser. The number is never sent to a server or stored.
Enter a National Identity Card number to read the date of birth, gender, and the equivalent number in the other format.
How a Sri Lankan NIC number is structured
Both formats carry the same three pieces of information in the same order: the year of birth, the day of the year the holder was born, and a serial number that distinguishes people born on the same day. Only the width of the year and serial fields differs.
The 10-character format that was issued until 2016 uses two digits for the year, which is why it can only express births in the 1900s. The 12-digit format replaced it with a full four-digit year and widened the serial from four digits to five.
| Field | Old format (10 characters) | New format (12 digits) |
|---|---|---|
| Year of birth | 2 digits, always 19xx | 4 digits |
| Day of year | 3 digits, +500 if female | 3 digits, +500 if female |
| Serial number | 4 digits | 5 digits |
| Suffix | V or X | None |
| Example | 751234567V | 197512304567 |
The female offset of 500
The middle three digits are a day-of-year ordinal from 1 to 366. For a female holder, 500 is added to that ordinal before it is written onto the card. Reading the field therefore means checking whether it exceeds 500, recording the gender, and subtracting 500 if it does.
This is why the two ranges never overlap and why nothing is ever issued between 367 and 500. A number in that gap is malformed, not a rare edge case.
| Digits | Reads as | Day of year | Example date |
|---|---|---|---|
| 001-366 | Male | The digits as written | 123 = 2 May |
| 367-500 | Nothing - malformed | - | - |
| 501-866 | Female | Digits minus 500 | 623 = 2 May |
Why leap years do not shift the encoding
The day-of-year table always allots February 29 days, whether or not the year of birth was a leap year. It is a fixed 366-slot calendar, not a re-based count, so 1 March is ordinal 61 for someone born in 1960 and equally for someone born in 1961.
The consequence is that ordinal 060 encodes 29 February. In a leap year that is a real date. In a common year it is not, and no birth date can honestly be resolved from such a number. This decoder reports the anomaly rather than rounding to 1 March, because reporting a date the holder never had is worse than reporting none.
| Month | Ends at day | Month | Ends at day |
|---|---|---|---|
| January | 31 | July | 213 |
| February | 60 | August | 244 |
| March | 91 | September | 274 |
| April | 121 | October | 305 |
| May | 152 | November | 335 |
| June | 182 | December | 366 |
Converting between the two formats
Old to new is always possible: prefix the century, then pad the serial to five digits with a leading zero. 751234567V becomes 197512304567 - the 19 is added, the day-of-year 123 is unchanged, and 4567 becomes 04567.
New to old is not always possible, and this is the step most conversion tables get wrong. It works only when the year is in the 1900s and the five-digit serial begins with a zero. A number such as 197512345678 has the serial 45678, and dropping any digit would produce a different number, so it simply has no 10-character form.
- Births from 2000 onwards have no old-format equivalent at all - two digits cannot express the century.
- A five-digit serial not starting with zero has no old-format equivalent either.
- The V or X suffix is not information the 12-digit number carries, so a round trip through the new format cannot recover it.
What changed after 2016
The Department of Registration of Persons stopped issuing the 10-character format in 2016. Cards already held remain valid and are still widely used, so both formats circulate and many systems must accept either.
Because the minimum age for a card is around 15, anyone young enough to be applying today receives the 12-digit format. An old-format number that decodes to a recent year of birth is worth re-reading before it is relied on.
What this tool cannot tell you
Structural validity is not authenticity. A number can decode cleanly and still never have been issued.
- There is no published check digit, so no offline tool can verify a NIC against the register.
- The gender field reflects what was recorded at registration, which may not match how the holder identifies.
- The serial number carries no district, ethnicity, or other demographic meaning, despite the folklore.
- For anything that depends on identity being correct, verify with the Department of Registration of Persons rather than with a decoder.