Spanish social security number generator

Generate test Spanish social security numbers (12 digits) and compute the two check digits of the first 10 digits. Everything happens in your browser.

Generated numbers are test data: they do not belong to real people, although one may match by chance.

Generate number

Generated number
Press Generate to create a number

Calculate check digits

The Spanish social security affiliation number has 12 digits: two for the province, eight for the sequence and two for the check. The check is the remainder of dividing the number formed by the province and the sequence by 97. This tool has two independent panels. The first generates a test number with a random province, shows it with slashes and breaks it into its parts so you can copy it. The second computes the check from the first 10 digits, which you can paste with spaces, slashes, hyphens or dots. The numbers are test data and do not belong to real people. Everything is computed in your browser, and nothing is sent or stored.

How to use it

  1. Press Generate in the Generate number panel to create a test number with a random province.
  2. Review the breakdown into province, sequence and check, and press Copy to take the number with slashes.
  3. To compute a check, type the first 10 digits in the Calculate check digits panel.
  4. Copy the full number with its two check digits, or fix the field if an error appears.

Frequently asked questions

How is the check digit calculated?
The province is joined to the eight-digit sequence, and the remainder of dividing that whole number by 97 is taken. The result, with two digits, is the check.
Which provinces does the tool accept?
It accepts codes from 01 to 52. Any other code, such as 00 or 53, is rejected with an unknown province message.
Are the generated numbers real?
No. They are test data with a correct structure and check, but they do not belong to real people, although one may match by chance.
Is anything sent to a server?
No. Numbers are generated and computed in your browser, and nothing is stored or placed in the URL.

Related tools