Mexican NSS Explained: Structure, Check Digit and How to Validate It
What the Mexican NSS (IMSS number) is, what each digit means, how the Luhn check digit works and how to validate numbers in bulk for payroll.

Every formal worker in Mexico has a Número de Seguridad Social (NSS). It appears on payslips, contracts, medical cards and pension documents, and a single wrong digit can stop a worker from being registered or leave contributions in limbo. This guide explains how the number is built and how to check it with the free NSS (IMSS Number) Validator.
What the NSS is
The NSS is an 11-digit number that the Mexican Social Security Institute (IMSS) assigns to each person for life. It is used to:
- Register workers with the IMSS through the employer.
- Book appointments and receive care at IMSS clinics.
- Check weeks of contributions.
- Calculate INFONAVIT points and credit.
- Manage the Afore and, later, the pension.
The structure
| Digits | Meaning |
|---|---|
| 1-2 | IMSS sub-delegation where you were first registered |
| 3-4 | Year of first registration |
| 5-6 | Year of birth |
| 7-10 | Consecutive number |
| 11 | Check digit |
So in 01089012346, the person was registered in sub-delegation 01 in 2008, was born in 1990, has consecutive number 1234 and check digit 6.
The check digit
The last digit is calculated from the first ten with the Luhn algorithm:
- Starting from the second digit, double every other digit.
- If doubling gives a number over 9, subtract 9.
- Add all ten resulting digits.
- The check digit is the amount needed to reach the next multiple of 10.
For 0108901234, the digits in the second, fourth, sixth, eighth and tenth positions are 1, 8, 0, 2 and 4. Doubled they give 2, 16, 0, 4 and 8, and 16 becomes 7. The other digits are 0, 0, 9, 1 and 3. The total is 2 + 7 + 0 + 4 + 8 + 0 + 0 + 9 + 1 + 3 = 34, so the check digit is 6, which brings it to 40.
The check digit catches most single typing mistakes and many swapped digits. It does not prove the number is assigned to a real person.
How to use the validator
- Type or paste an NSS.
- Read the result: valid check digit, wrong check digit with the expected digit, or wrong length.
- See the structure: sub-delegation, registration year and birth year.
- For payroll, paste a list of numbers, one per line, in the batch box.
- Review each result and download the CSV to fix errors in your system.
The tool also warns when the birth year comes after the registration year, which usually means a typing error.
Common problems
- One digit wrong: the check digit fails.
- Two digits swapped: usually detected.
- Duplicate NSS: a worker who requested a new number instead of using the old one. This splits their weeks of contributions; the IMSS can unify them.
- Old temporary numbers: replaced by the definitive NSS.
How workers get their NSS
The NSS can be requested free on the IMSS website or app with the CURP and an email address. The IMSS sends a document with the number. Employers should ask new workers for this document rather than copying the number from an old payslip.
Why it matters for employers
Registering workers with a wrong NSS leads to rejected movements in the IMSS system, contributions not credited to the worker and problems when the worker needs medical care or a disability benefit. A quick batch check before each upload prevents most of these issues.
Where the NSS appears
You can find your NSS on payslips (recibos de nómina), on the IMSS digital app, on your Afore statement and on the IMSS document sent when you request it. If two documents show different numbers, ask the IMSS which one is correct before your employer registers you.
Limits
The validator checks the structure and the check digit only. To confirm that a number belongs to a person, use the IMSS services. Two-digit years are interpreted as 2000s up to 26.



