Generator · Bulgarian data
Bulgarian EIK
Endpoint GET /v1/bg/eik
What it covers
Returns a valid Bulgarian EIK (Единен идентификационен код, the company/Bulstat number) with a correct two-stage check digit. Use `format=vat` for the BG VAT number (`BG` + EIK). Set `invalid=true` for an EIK with a deliberately wrong check digit.
How it’s calculated
The 9th digit of a Bulgarian EIK/BULSTAT is a two-stage weighted-sum modulo-11 check digit over the eight preceding digits, with a fallback second weight set used only when the first stage produces the ambiguous residue 10.
Algorithm
- Take the eight payload digits d1 d2 d3 d4 d5 d6 d7 d8 (positions 1 through 8, left to right). The first digit d1 is 1-9; the rest are 0-9.
- STAGE ONE: multiply each digit by its stage-one weight, where the weights are [1, 2, 3, 4, 5, 6, 7, 8] applied in order (d1*1, d2*2, ..., d8*8). Sum all eight products.
- Compute residueOne = (stage-one sum) mod 11.
- If residueOne is less than 10, the check digit is residueOne. Stop.
- STAGE TWO (only reached when residueOne == 10): multiply each of the same eight digits by its stage-two weight, where the weights are [3, 4, 5, 6, 7, 8, 9, 10] applied in order (d1*3, d2*4, ..., d8*10). Sum all eight products.
- Compute residueTwo = (stage-two sum) mod 11.
- If residueTwo == 10, the check digit is 0; otherwise the check digit is residueTwo.
- Append the resulting single check digit as the 9th digit to form the full 9-digit EIK.
Worked example
EIK payload 1234 5678 with check digit ? -> 12345678?
Payload digits: [1, 2, 3, 4, 5, 6, 7, 8].
Stage-one weights: [1, 2, 3, 4, 5, 6, 7, 8].
Products: 1*1=1, 2*2=4, 3*3=9, 4*4=16, 5*5=25, 6*6=36, 7*7=49, 8*8=64.
Stage-one sum = 1+4+9+16+25+36+49+64 = 204.
residueOne = 204 mod 11: 11*18 = 198, 204 - 198 = 6, so residueOne = 6.
residueOne (6) is less than 10, so the check digit is 6. Stage two is not needed.The check digit is 6, so the full 9-digit EIK is 123456786.
Edge cases
- Stage two is only ever consulted when the stage-one residue equals exactly 10; for every other payload the check digit is simply the stage-one residue (0-9).
- When the stage-two residue is also 10, the check digit is mapped to 0 rather than being left as a two-character value, keeping the identifier a single 9-digit string.
Gotchas
- The weighted sum here is a plain positional sum (weightedSum) taken directly mod 11 — it is NOT an 11-complement scheme; the residue itself is the check digit, so residue 0 yields check digit 0.
- This generator produces the 9-digit EIK form (legal entities / sole traders). The 13-digit BULSTAT form used by branches and some registrations has its own separate two-weight rule and is not what this generator emits.
- Weights start at 1 (not the position index+? offset seen in some schemes): d1 is multiplied by 1 in stage one and by 3 in stage two.
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 EIKs 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 9-digit EIK (default) or BG VAT number. |
| invalid | boolean | Return an EIK 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 identifier in the requested format (national EIK or BG VAT). |
| digits | string | The canonical, unprefixed 9-digit EIK. |
Other generators for Bulgaria
Bulgarian companyBulgarian company nameBulgarian EGNBulgarian email addressBulgarian IBANBulgarian personBulgarian person nameBulgarian product or service offeringBulgarian vehicle registration plate
See all generators for Bulgaria →The same kind of identifier elsewhere
Austrian data · Austrian FirmenbuchnummerAustrian data · Austrian SteuernummerAustrian data · Austrian UIDBelgian data · Belgian OndernemingsnummerCzech 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 CIFSwedish data · Swedish organisationsnummer
Try it