Generator · Slovenian data

Slovenian EMŠO

Endpoint GET /v1/si/emso

What it covers

Returns a valid Slovenian EMŠO (Enotna matična številka občana) with a correct mod-11 check digit. Constrain with `sex` and age/birth-date filters (the full birth date is encoded). Contradictory combinations are rejected with a 400. Set `invalid=true` for a deliberately wrong check digit.

How it’s calculated

The 13th digit of a Slovenian EMŠO is a weighted mod-11 check over the first twelve digits, using the 11-complement, with residue 0 mapping to check 0 and residue 1 rejected as unissued.

Algorithm

  1. Take the first 12 digits of the EMŠO in order. They are DDMMYYY RR BBB: day (2), month (2), last three digits of the birth year (3), a two-digit region code RR (Slovenia uses 50–59), and a three-digit serial BBB.
  2. Apply the fixed position weights [7, 6, 5, 4, 3, 2, 7, 6, 5, 4, 3, 2] to those 12 digits, position by position (digit 1 × 7, digit 2 × 6, …, digit 12 × 2).
  3. Sum all twelve products to get the weighted sum S.
  4. Compute the residue r = S mod 11.
  5. If r = 0, the check digit is 0.
  6. If r = 1, there is no valid single-digit check (the 11-complement would be 10, which cannot be written in one position); this EMŠO is not issued — in generation the region/serial are redrawn.
  7. Otherwise the check digit is 11 − r (a value from 2 through 9).
  8. Append the check digit as the 13th digit.

Worked example

Female born 1988-05-23, region 50, serial 500 → EMŠO 230598850500?

First twelve digits: DD=23, MM=05, YYY=988 (1988 mod 1000), RR=50, BBB=500 → 2 3 0 5 9 8 8 5 0 5 0 0
Weights: 7 6 5 4 3 2 7 6 5 4 3 2
Products: 2×7=14, 3×6=18, 0×5=0, 5×4=20, 9×3=27, 8×2=16, 8×7=56, 5×6=30, 0×5=0, 5×4=20, 0×3=0, 0×2=0
Sum S = 14+18+0+20+27+16+56+30+0+20+0+0 = 201
Residue r = 201 mod 11 = 3 (11×18=198, 201−198=3)
r is neither 0 nor 1, so check = 11 − 3 = 8

The check digit is 8, giving the full EMŠO 2305988505008.

Edge cases

  • Residue 1 has no representable check digit (the complement would be 10); such a candidate is not a valid EMŠO. The generator loops and redraws the region and serial until a valid check digit exists.
  • Residue 0 yields check digit 0 (not 11), so it is handled as a special case separate from the 11 − r complement.
  • The year field YYY is only the last three digits of the birth year (year mod 1000), so 1988 and 2988 would share the same date head; the generator only encodes 1900–2099.

Gotchas

  • The serial band BBB encodes sex: 000–499 is male, 500–999 is female. It is part of the checksummed payload, so changing the sex band changes the check digit.
  • The weight pattern is the palindrome-free repeat 7 6 5 4 3 2 applied twice across the 12 payload digits, not a single run of descending weights.
  • Only the first 12 digits enter the weighted sum; the 13th (check) digit itself is never weighted.

Parameters

ParameterTypeDescription
atAgeintegerExact age in years at request time.
bornAfterstringpattern ^\d{4}(?:-\d{2}(?:-\d{2})?)?$Born after this date or fragment (YYYY, YYYY-MM, YYYY-MM-DD).
bornBeforestringpattern ^\d{4}(?:-\d{2}(?:-\d{2})?)?$Born before this date or fragment (YYYY, YYYY-MM, YYYY-MM-DD).
bornOnstringpattern ^\d{4}(?:-\d{2}(?:-\d{2})?)?$Born on a date or within a fragment: YYYY, YYYY-MM, or YYYY-MM-DD.
countinteger1–1000Number of records to return, 1–1000 (your plan may lower this). Omitted returns a single record; set it for a batch.
edgebooleanRestrict output to edge-case values.
extremebooleanReturn 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.
invalidbooleanReturn an EMŠO with a deliberately wrong check digit; date/sex stay valid.
olderThanintegerMinimum age in years at request time.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.
sex"m" | "f"Encoded sex: "m" or "f".
youngerThanintegerMaximum age in years at request time.

Response fields

FieldTypeDescription
valuestringThe EMŠO rendered as the bare 13 digits.
digitsstringThe canonical 13-digit EMŠO.
birthDatestringThe encoded birth date, ISO `YYYY-MM-DD`.
sex"m" | "f"Encoded sex: `m` (serial 000–499) or `f` (serial 500–999).

Other generators for Slovenia

See all generators for Slovenia →

The same kind of identifier elsewhere

Try it

Generate a live example below — every response is valid by format and entirely synthetic.