Swiss Social Security Number

To Validate and Generate a Switzerland Social Security Number - Easily and Quickly.


This is an Switzerland Social Security Number validation tool, you can enter the appropriate value to get the verification results, for the convenience of use, the tool provides a generator, you can use the generator to test the results.

756.7538.5284.04
✕ Invalid Swiss SSN

What is Switzerland Social Security Number?

On July 1, 2008 the old grey AHV card with an 11-digit number was replaced by a new standard credit card sized document containing 13 digits. The new number is generated randomly and is completely anonymous, thereby fulfilling current data protection requirements. Insured persons retain the same number throughout their lives and no longer need to replace it in the event of a name change due to marriage or divorce. If you still have an 11-digit AHV number, you can request for a new 13-digit AHV number through your employer who happens to be the one responsible for ordering the card.

Switzerland Social Security Number Generation and Validation?

The Switzerland Social Security Number Generator is designed to developers in need of randomly generated data for testing cases. The SSN validation validates the numbers pattern for a given state area code. Therefore, if a SSN passes this tool validation, it doesn't mean that it really exists, only that it's code, for the given pattern, is possible. This is the same validation that guarantees the basic authentication, of generated ssn's, for forms under development, as they merely checks for a possible pattern. Generated SSN's aren't real, and shouldn't be used on attempt of any illegal activity.

Test data for developers

The generator on this page exists for one purpose: producing structurally valid numbers to exercise code that handles AHV/AVS identifiers, without touching anyone's real data.

Why never to use real numbers in testing

Real identifiers in a test environment are a liability, and a familiar one:

  • Test databases are backed up less carefully, shared more widely, and audited less than production.
  • Fixtures get committed to version control and outlive the branch they were written for.
  • Test data leaks into logs, error reports and analytics tooling.
  • Under the Swiss FADP and the GDPR, personal data in a test system is still personal data, with the same obligations attached.

Generated numbers avoid all of it. They exercise the same code paths because they satisfy the same structural rules.

Cases worth covering

A validator is only as good as the inputs it has been tried against. Beyond valid numbers, worth testing:

  • A correct number with a wrong check digit — the single most common real-world error, since it is what a typo produces.
  • Transposed digits, which the EAN-13 checksum is specifically designed to catch.
  • Numbers with the wrong prefix — anything not starting 756.
  • Correct digits with missing or misplaced dots, and with surrounding whitespace.
  • Wrong lengths: twelve digits, fourteen digits, empty input.

Storage advice

Store the thirteen digits as a string, not an integer — the leading 756 is fine, but treating identifiers as numbers invites trouble the moment a format changes. Normalise by stripping dots on input and re-formatting on display.

Generated numbers are not real and are not issued to anyone. They are for development and testing only.

Related Swiss AHV/AVS tools