NSS validator: verify the mod 97 check digits
A Spanish Social Security number (NSS) is valid if it has 12 digits and the last 2 match the remainder of dividing the province and registration number by 97 (a remainder of 0 is written as 97). This NSS validator runs the calculation in your browser: it checks the format, but does not query Spain's General Treasury of Social Security.
Paste a 12-digit NSS and we check whether the last 2 digits match the remainder of dividing the province and number by 97.
Quick validator
Check whether a DNI, NIE, CIF, IBAN, card number, NSS or CCC has a valid format and check digit.
The validator checks format and check digits. It does not check whether the document or account exists. The value is never sent to any server or stored in the URL.
How it's calculated
Province (2) + number (8) + 2 Mod 97 check digits (a remainder of 0 is written as 97).
Remainder of dividing province + number by 97; if the remainder is 0, the check is 97.
- 1Province + number (10 digits)4837152063
- 2Mod 97 remainder4
- 3Check (0 is written as 97)04
Frequently asked questions
How many digits does the Social Security number have?
12 digits: 2 for the province, 8 for the registration number and 2 check digits.
What happens if the remainder of dividing by 97 is 0?
The expected NSS check is 97, not 00; if the number has 00 in that case, it is marked as invalid.
Does the NSS validator query the Social Security system?
No. It only checks the mathematical algorithm; it does not access any system of Spain's General Treasury of Social Security.
Keep exploring
Need to validate another data type? Use the full validator.