Spanish Social Security number generator (NSS)

The Spanish Social Security number (NSS or NUSS) has 12 digits: 2 for the province, 8 for the number and 2 check digits. The check is the remainder of dividing the first 10 digits by 97. NSS numbers generated by DataMockSeed are fake: they validate in payroll or HR forms, but belong to no real person registered with Social Security.

The NSS combines the province code, a sequential number and 2 check digits calculated from the remainder of dividing by 97 (if the remainder is 0, the check is 97).

5 generated examples
462664428877Valid
289818493621Valid
219630151463Valid
329521349211Valid
525149674366Valid

How it's calculated

Province (2) + number (8) + 2 Mod 97 check digits (a remainder of 0 is written as 97).

Generated sample
462664428877

Remainder of dividing province + number by 97; if the remainder is 0, the check is 97.

  1. 1
    Province + number (10 digits)
    4626644288
  2. 2
    Mod 97 remainder
    77
  3. 3
    Check (0 is written as 97)
    77

Frequently asked questions

Do the generated NSS numbers belong to real people?

No. The number is random; only the check digit calculation follows the algorithm of Spain's General Treasury of Social Security (TGSS).

Why is the NSS check sometimes 97 and not 00?

Because when the remainder of dividing by 97 is 0, the check is written as 97 instead of 00.

What is a test Social Security number used for?

To test payroll, HR or insurance forms that validate the NSS format, without using a real person's data.

Keep exploring

Looking for more data types? Try the full generator.