Generator · Slovenian data
Slovenian davčna številka
Endpoint GET /v1/si/davcna-stevilka
What it covers
Returns a valid Slovenian davčna številka (tax number for a person or company) with a correct check digit. Use `format=vat` for the SI VAT number. Set `invalid=true` for a tax number with a deliberately wrong check digit.
How it’s calculated
The Slovenian davčna številka appends one check digit to seven payload digits using a weighted sum modulo 11, taking the 11-complement — except residue 1 collapses to check digit 0 and residue 0 has no valid check digit (unissued prefix).
Algorithm
- Take the seven payload digits d1..d7 (the eighth is the check digit). d1 is drawn 1-9, d2..d7 are 0-9.
- Apply the fixed position weights [8, 7, 6, 5, 4, 3, 2] to d1..d7 respectively.
- Compute the weighted sum: sum = 8*d1 + 7*d2 + 6*d3 + 5*d4 + 4*d5 + 3*d6 + 2*d7.
- Compute residue r = sum mod 11.
- If r == 0: there is no valid single-digit check (the 11-complement would be 11); this prefix is UNISSUED and must be redrawn — no valid tax number exists for it.
- If r == 1: the check digit is 0 (the 11-complement would be 10, which is collapsed to 0).
- Otherwise the check digit is (11 - r), a value in 2..9 (or... see note: r in 2..10 gives 11-r in 1..9).
- Append the check digit as the eighth digit to form the 8-digit davčna številka. The VAT form prefixes 'SI' (e.g. SI15003655).
Worked example
davčna številka 1500365? (seven payload digits, ? = check digit)
Payload digits: d1..d7 = 1,5,0,0,3,6,5
Weights: 8,7,6,5,4,3,2
Products: 1*8=8, 5*7=35, 0*6=0, 0*5=0, 3*4=12, 6*3=18, 5*2=10
Weighted sum = 8+35+0+0+12+18+10 = 83
Residue r = 83 mod 11 = 6 (11*7=77, 83-77=6)
r is neither 0 nor 1, so check = 11 - 6 = 5The check digit is 5, giving the full davčna številka 15003655 (VAT form SI15003655).
Edge cases
- Residue r == 1 → check digit is 0 (the naive 11-complement of 10 is folded down to 0), not rejected.
- Residue r == 0 → NO valid check digit exists (11-complement would be 11); the generator treats this prefix as unissued and redraws seven new payload digits.
- The first payload digit d1 is always drawn 1-9 (never 0), matching the common shape of a real davčna številka.
Gotchas
- This is NOT the plain 11-complement used by some other IDs: the two special residues (0 and 1) are handled differently — 1 maps to 0, and 0 is invalid rather than mapped.
- The shared weightedSum primitive returns only the raw positional weighted sum; the mod-11, the complement, and both special-case rules are applied inline in computeDavcnaCheckDigit, not inside the primitive.
- The same davčna številka identifies both persons and companies; there is no sex or century marker in the number — all eight digits except the check are unstructured payload.
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 tax numbers 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 8-digit national tax number (default) or SI VAT number. |
| invalid | boolean | Return a tax number with a deliberately wrong 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 tax number in the requested format (national or VAT). |
| digits | string | The canonical, unprefixed 8-digit tax number. |
Other generators for Slovenia
Slovenian companySlovenian company nameSlovenian email addressSlovenian EMŠOSlovenian IBANSlovenian personSlovenian person nameSlovenian product or service offeringSlovenian vehicle registration plate
See all generators for Slovenia →The same kind of identifier elsewhere
Austrian data · Austrian SVNRBelgian data · Belgian RijksregisternummerBulgarian data · Bulgarian EGNCroatian data · Croatian JMBGCroatian data · Croatian OIBCypriot data · Cyprus TICCzech data · Czech rodné čísloDanish data · Danish CPRDutch data · Dutch BSNEstonian data · Estonian isikukoodFinnish data · Finnish henkilötunnusFinnish data · Finnish Y-tunnusFrench data · French NIRGerman data · German Steuer-IdNrGreek data · Greek AFMGreek data · Greek AMKAHungarian data · Hungarian adóazonosító jelHungarian data · Hungarian személyi azonosítóHungarian data · Hungarian TAJIrish data · Irish PPSNItalian data · Italian Codice FiscaleLatvian data · Latvian personas kodsLithuanian data · Lithuanian asmens kodasLuxembourg data · Luxembourg matriculePolish data · Polish PESELPortuguese data · Portuguese NIFRomanian data · Romanian CNPSlovak data · Slovak rodné čísloSpanish data · Spanish DNISpanish data · Spanish NIESwedish data · Swedish personnummer
Try it