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.

Try:

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 layout of the two NIC formats
FieldOld format (10 characters)New format (12 digits)
Year of birth2 digits, always 19xx4 digits
Day of year3 digits, +500 if female3 digits, +500 if female
Serial number4 digits5 digits
SuffixV or XNone
Example751234567V197512304567

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.

How the day-of-year field encodes gender
DigitsReads asDay of yearExample date
001-366MaleThe digits as written123 = 2 May
367-500Nothing - malformed--
501-866FemaleDigits minus 500623 = 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.

Cumulative day-of-year at the end of each month
MonthEnds at dayMonthEnds at day
January31July213
February60August244
March91September274
April121October305
May152November335
June182December366

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.

More everyday tools

Frequently asked questions

The old 10-character format is YYDDDSSSSL: two digits for the year of birth, three for the day of the year, four for a serial number, and a V or X suffix. The 12-digit format issued today is YYYYDDDSSSSS: a full four-digit year, the same three-digit day of the year, and a five-digit serial. The date of birth and gender are carried by the first seven digits in both.

The three-digit day-of-year field carries 500 added to it for female holders. A card reading 123 is a male born on the 123rd day of the year; one reading 623 is a female born on that same day. Male cards therefore run from 001 to 366 and female cards from 501 to 866, and nothing is ever issued between 367 and 500.

Add 19 in front of the two-digit year and insert a zero before the four-digit serial, so 751234567V becomes 197512304567. Going the other way only works when the year is in the 1900s and the five-digit serial starts with a zero - otherwise a digit would have to be dropped, and the number has no 10-character equivalent.

The Department of Registration of Persons encodes birth dates against a fixed 366-day calendar in which February always has 29 days, and the table is not re-based for common years. That is why 1 March is day 61 in every year, leap or not. It also means day 060 encodes 29 February, a date that does not exist outside a leap year, so this decoder flags that case instead of quietly reporting 1 March.

The letter records the voting-register status noted when the card was issued: V for a holder entered on the register and X for one who was not. It does not change the date of birth, the gender digit, or the validity of the number, and the 12-digit format issued since 2016 carries no suffix at all.

No. It checks that a number is structurally possible - correct length, a day of the year that exists, a plausible year of birth - and reports what those digits decode to. The Department of Registration of Persons has not published a check-digit algorithm, so no offline tool can confirm that a number was actually issued or that it belongs to a particular person.

No. The decoding runs in JavaScript inside your browser. The number is not transmitted to a server, written to a database, or included in any analytics event.

The digits after the year encode the day of the year. Subtract 500 first if the value exceeds 500 - that offset marks a female holder - then resolve the remainder against a fixed 366-day calendar. This calculator does both steps and returns the date.

Take the two-digit year and expand it to four digits, keep the day-of-year and serial digits, and drop the trailing letter. The new twelve-digit number encodes exactly the same date of birth and sex as the old one, which is why the conversion is reversible.

It is the encoding the Department for Registration of Persons uses to record sex within the same digit field as the day of the year. Because a year has at most 366 days, adding 500 leaves no ambiguity about which is which.

It is a suffix on the old ten-character format and is not part of the date or sex encoding. The newer twelve-digit format has no trailing letter at all, which is the quickest way to tell the two formats apart.

No, and that is deliberate. The encoding uses a fixed 366-day calendar for every year, so the day-of-year value maps consistently whether or not the birth year was a leap year. Applying a normal calendar to a non-leap year would shift dates after February by one day.