DevTools Logo

Portugal NISS Generator

Portugal NISS Generator

Generate 11-digit Portuguese social security numbers (NISS) for people and companies — synthetic test data only

Runs in your browser

For Development & Testing Purposes Only - Synthetic Mock Data

Settings

1 value

Generates one value with a valid checksum. Press ⌘/Ctrl+Enter for a fresh one.

Generated value

No value yet

Set options, then press Generate.

Generated values are valid in shape but randomized (Test Data).

Legal Disclaimer: Generated data is for software testing and validation purposes only (e.g. verifying input masks, form validation, or database seeding). It is randomly generated and not taken from any real record, but a random value can coincidentally match a real, issued number, so never use it in real applications, payments, KYC or official forms. Using it to impersonate real people or for any fraudulent activity is illegal. DevTools accepts no liability for how generated data is used.

    Examples

    Generate a personal NISS

    Input
    NISS · person · Generate
    Output
    12345678902

    The leading 1 marks a person and the final 2 is the weighted mod-10 check digit.

    Validate a pasted value

    Input
    12345678902
    Output
    Valid — person number with check digit 2

    The validator recomputes the weighted sum over the first ten digits.

    Reject a wrong prefix

    Input
    31234567890
    Output
    Invalid — a NISS starts with 1 (person) or 2 (company); this starts with 3

    The prefix test fails before the check digit is evaluated.

    About this tool

    The Portugal NISS Generator produces one 11-digit NISS (Número de Identificação da Segurança Social), the social security number used by people and companies. Choose the person option for a value starting with 1 or the company option for one starting with 2.

    The check digit is 9 minus the weighted sum of the first ten digits modulo 10, using weights 29, 23, 19, 17, 13, 11, 7, 5, 3 and 2. Generation derives that digit, and validation recomputes it after stripping spaces.

    These are synthetic values for QA and development, never for real applications, KYC checks, tax filings, identity documents or impersonation. A random value can coincide with a real, issued number, and DevTools accepts no liability for how generated data is used. Everything runs locally in your browser.

    What this tool does not do

    • Covers NISS only; NIF and NIPC have a separate tool.
    • Validation checks structure and check digit, not registration status.
    • A random value can match a real person's or company's NISS.
    • The tool does not model contribution history or benefit eligibility.

    How to use this tool

    1. Pick person or company

      Choose the person option for a NISS starting with 1, or the company option for one starting with 2.

    2. Generate a value

      Click Generate to create one 11-digit number and append the weighted mod-10 check digit.

    3. Validate or copy

      Switch to Validate to check a pasted NISS, or copy the result and download it as a .txt file.

    Use cases

    Social security field fixtures

    Seed Portuguese social security forms with a value that passes the weighted check instead of a real NISS.

    Payroll form tests

    Exercise payroll and benefits screens that require an 11-digit social security number.

    Person vs company coverage

    Generate both prefixes so your form handles individual and corporate contributors separately.

    NISS layout and check

    PartRule
    Length11 digits
    First digit1 for a person, 2 for a company
    Weights29, 23, 19, 17, 13, 11, 7, 5, 3, 2 over the first 10 digits
    Check digit9 − (weighted sum mod 10)
    ValidationChecks prefix, length and check digit

    Spaces are ignored during validation; letters are rejected as malformed.

    Common mistakes

    Mistake:Reusing the NIF check rule

    Fix:NISS uses its own weights and a 9-minus-remainder rule, not the NIF mod-11 check.

    Mistake:Assuming the first digit is random

    Fix:1 marks a person and 2 marks a company, so the prefix changes the meaning.

    Mistake:Expecting letters in a NISS

    Fix:The value is all digits; spaces are ignored but letters are rejected.

    Frequently asked questions

    Are these real Portuguese NISS numbers?

    No. They are synthetic values for QA and development and must not be used for real social security claims, tax filings, KYC checks, or identity documents; DevTools accepts no liability for their use.

    How is a NISS different from a NIF?

    A NISS is the eleven-digit social security number, while a NIF is the nine-digit tax number. They use different lengths, prefixes and check rules, and DevTools has a separate tool for each.

    What do the first digits mean?

    A NISS starting with 1 belongs to a person and one starting with 2 belongs to a company. The validator rejects any other leading digit before it checks the checksum.

    Can a generated NISS match a real person or company?

    It can. The weighted check only proves the number is well formed, so a random value may coincide with a real issued NISS. Use generated values in test environments only.

    Is there a check digit in a NISS?

    Yes. The eleventh digit is 9 minus the weighted sum of the first ten digits modulo 10, using the fixed weights 29, 23, 19, 17, 13, 11, 7, 5, 3 and 2.

    References & standards