How the number is built and checked
The AHV number (AVS in French and Italian; AHVN13) has thirteen digits, written 756.1234.5678.97: 756, the ISO country code of Switzerland, which every number starts with; nine digits drawn at random from those not yet used; and a check digit. It is a “non-speaking” identifier: the number alone says nothing about the person. [1]
The check digit follows EAN-13: starting from the second-last digit and moving left, multiply the digits alternately by 3 and 1, add, and top the sum up to the next multiple of 10. For the Federal Social Insurance Office's example 7 5 6 1 2 3 4 5 6 7 8 9: 7 + 15 + 6 + 3 + 2 + 9 + 4 + 15 + 6 + 21 + 8 + 27 = 123, and 130 − 123 = 7. [2]
One random number in ten has the right check digit, so nullcipher masks it only when AHV, AVS, AHVN13, NAVS13 or Sozialversicherungsnummer stands within 40 characters before it. It accepts the dotted form, groups separated by spaces, or thirteen digits in a row.
How nullcipher recognises it
756, nine further digits and an EAN-13 check digit (digits multiplied alternately by 1 and 3, the check digit topping the sum up to the next multiple of 10), written 756.1234.5678.97, 756 1234 5678 97 or as thirteen digits. Masked with a context word — AHV, AVS, AHV-Nr., AHVN13, NAVS13, Sozialversicherungsnummer — within 40 characters before it.
This is the rule text of the “Swiss AHV/AVS number” detector in the masking engine, copied from the engine when this page was built. Detectors run in a fixed order and, where two overlap, the earlier one wins.
Example (fake)
AHV-Nr. 756.1234.5678.97
nullcipher replaces it with [AHV_1]. This is the example the Federal Social Insurance Office uses in its guidance (WL VA/IK, annex 7) to show how the check digit is computed.
Why it matters in an AI chat
The number carries no personal data itself, but the Central Compensation Office links it to the person's names, birth date, sex, nationalities, parents' names and place of birth, and it is used in social insurance, population and education statistics, health-care billing, tax administrations and other public registers.
Because so many registers share it, a leaked number is a key that joins up records about one person.
Masked, the AI sees [AHV_1] and can still help with the rest of the text.
If it already leaked
- Work out which data were affected; if bank or card details went with it, contact your bank at once, have the cards blocked and check your statements for suspicious transactions. [3]
- If your data were used for fraudulent orders or account openings, tell the services concerned, change your access data there, and file a report with the cantonal police. Watch for targeted phishing in the weeks after. [3]
- If it only went into an AI chat and there is no sign of misuse, delete the conversation — how, for each major assistant, is on the page listing every type. The AHV number itself stays the same.
Sources
- AHV-Nummer — Zentrale Ausgleichsstelle ZAS — checked 2026-10-03.
- Wegleitung über Versicherungsausweis und individuelles Konto (WL VA/IK), Anhang 7: Kontrollzifferprüfung — Bundesamt für Sozialversicherungen — checked 2026-10-03.
- Konto gehackt oder Daten abgeflossen — Bundesamt für Cybersicherheit (NCSC) — checked 2026-10-03.
Open the full masking tool to mask a whole log, .env file or e-mail — every type at once — and restore the values in the AI's answer. Or see all 242 detectors, with a page for 59 secret types, and how to delete a chat you already sent.