Generator · Swedish data
Swedish organisationsnummer
Endpoint GET /v1/se/organisationsnummer
What it covers
Returns a valid Swedish organisationsnummer (legal-entity identifier) with a correct Luhn check digit. Use `format` for the SE VAT number. Set `invalid=true` for a number with a deliberately wrong check digit.
How it’s calculated
The 10th digit of a Swedish organisationsnummer is a Luhn (mod-10) check digit over the nine preceding payload digits.
Algorithm
- Take the nine payload digits d1 d2 d3 d4 d5 d6 d7 d8 d9 (the check digit is NOT yet appended). d1 is 1-9 (entity-type group), d3 is >= 2, the rest are 0-9.
- Process the payload from right to left. Set an alternating flag 'doubling' = true for the rightmost payload digit (d9), then flip it on every subsequent digit (so d9, d7, d5, d3, d1 are doubled; d8, d6, d4, d2 are taken as-is).
- For each digit: if 'doubling' is true, multiply the digit by 2, and if the product exceeds 9 subtract 9 (equivalently, add the two decimal digits of the product).
- Add every resulting value into a running sum.
- Compute the check digit as (10 - (sum mod 10)) mod 10. The outer mod 10 makes a residue of 0 yield check digit 0 rather than 10.
- Append this check digit as the 10th digit to form the canonical 10-digit organisationsnummer. (The 'vat' format then wraps it as SE + the 10 digits + 01.)
Worked example
Organisationsnummer 16556123 4-? (payload 165561234, check digit ?)
Payload digits, left to right (indices 0-8): 1, 6, 5, 5, 6, 1, 2, 3, 4.
Process right to left; rightmost (4) is doubled, then alternate.
4 doubled = 8.
3 as-is = 3.
2 doubled = 4.
1 as-is = 1.
6 doubled = 12 -> 12-9 = 3.
5 as-is = 5.
5 doubled = 10 -> 10-9 = 1.
6 as-is = 6.
1 doubled = 2.
Sum = 8 + 3 + 4 + 1 + 3 + 5 + 1 + 6 + 2 = 33.
Check digit = (10 - (33 mod 10)) mod 10 = (10 - 3) mod 10 = 7.The check digit is 7, giving the full organisationsnummer 1655612347.
Edge cases
- Zero check digit: when the Luhn residue is 0, the check digit is 0 (the (10 - sum%10) % 10 outer mod handles this). A naive numeric parse that drops a trailing zero would mangle such a number.
- Minimum third digit: d3 = 2 is the smallest legal value (the historic 'month pair' >= 20 that separates organisations from personnummer).
- Entity-type group: d1 ranges 1-9; leading zero is never produced, so the first digit is always significant.
Gotchas
- This is plain Luhn — no per-position weight vector is passed to luhnCheckDigit; the weights are Luhn's implicit alternating 2,1,2,1,... applied from the rightmost payload digit inward.
- The rightmost PAYLOAD digit (d9) is the first to be doubled. Because the check digit is not part of the payload here, doubling starts 'true'; validation over the full 10 digits instead starts 'false' (isValidLuhn).
- The generator's Luhn only checks the checksum; it does NOT verify the entity actually exists in Bolagsverket's register — values are structurally valid but synthetic.
Parameters
| Parameter | Type | Description |
|---|---|---|
| count | integer1–1000 | Number of records to return, 1–1000 (your plan may lower this). Omitted returns a single record; set it for a batch. |
| edge | boolean | Restrict output to valid edge-case organisationsnummer from the rare corners. |
| extreme | boolean | Return a correct value wrapped in a hostile encoding (untrimmed whitespace, invisible/zero-width characters, BOM, or bidi/combining marks). Homoglyphs are excluded so the value stays machine-parseable; it still validates after normalisation. |
| format | "national" | "vat" | Rendering: bare 10-digit national number (default) or SE VAT number. |
| invalid | boolean | Return a number with a deliberately wrong Luhn check digit. |
| seed | integer | Integer seed for reproducible output: the same seed always yields the same record. |
Response fields
| Field | Type | Description |
|---|---|---|
| value | string | The identifier in the requested format (national or VAT). |
| digits | string | The canonical, unprefixed 10-digit number. |
Other generators for Sweden
Swedish companySwedish company nameSwedish email addressSwedish IBANSwedish personSwedish person nameSwedish personnummerSwedish product or service offeringSwedish vehicle registration plate
See all generators for Sweden →The same kind of identifier elsewhere
Austrian data · Austrian FirmenbuchnummerAustrian data · Austrian SteuernummerAustrian data · Austrian UIDBelgian data · Belgian OndernemingsnummerBulgarian data · Bulgarian EIKCzech data · Czech IČODanish data · Danish CVRDutch data · Dutch btw-idDutch data · Dutch KvK numberDutch data · Dutch RSINEstonian data · Estonian KMKREstonian data · Estonian registrikoodFrench data · French SIRENGerman data · German HandelsregisternummerGerman data · German Personalausweis numberGerman data · German USt-IdNrGerman data · German Wirtschafts-IdNrHungarian data · Hungarian adószámHungarian data · Hungarian cégjegyzékszámIrish data · Irish CRO numberIrish data · Irish VAT numberItalian data · Italian Partita IVALatvian data · Latvian registracijas numursLithuanian data · Lithuanian įmonės kodasLithuanian data · Lithuanian PVM (VAT) numberLuxembourg data · Luxembourg TVAMaltese data · Maltese identity card numberMaltese data · Maltese VAT numberPolish data · Polish driving licence numberPolish data · Polish ID card numberPolish data · Polish KRS numberPolish data · Polish land and mortgage register numberPolish data · Polish NIPPolish data · Polish passport numberPolish data · Polish REGONPortuguese data · Portuguese Cartão de Cidadão numberRomanian data · Romanian CUI/CIFSlovak data · Slovak IČ DPHSlovak data · Slovak IČOSpanish data · Spanish CIF
Try it