Generator · Romanian data
Romanian CUI/CIF
Endpoint GET /v1/ro/cui
What it covers
Returns a valid Romanian CUI/CIF (company identifier) with a correct control digit. Use `format=vat` for the RO VAT number (RO + CUI). Set `invalid=true` for a CUI with a deliberately wrong control digit.
How it’s calculated
The Romanian CUI (Cod Unic de Înregistrare / fiscal code) check digit is a weighted sum against the fixed key 7,5,3,2,1,7,5,3,2 over the zero-padded 9-digit body, multiplied by 10, taken modulo 11, then modulo 10.
Algorithm
- Start with the CUI body — the significant digits before the control digit (in this generator, 6 to 9 digits, first digit 1-9, rest 0-9).
- Left-pad the body with zeros to exactly 9 digits.
- Define the fixed control key of 9 weights: [7, 5, 3, 2, 1, 7, 5, 3, 2].
- Multiply each of the 9 padded digits by the weight in the same position and sum all 9 products (a plain weighted sum, no intermediate modulus).
- Multiply that sum by 10.
- Take the result modulo 11.
- Take that modulo 10 (so a raw remainder of 10 collapses to 0). This single digit 0-9 is the control digit.
- Append the control digit to the (unpadded) body to form the full CUI. For a VAT number, prefix the whole thing with 'RO'.
Worked example
CUI body 123456, control digit = ?
Body = "123456" (6 digits). Left-pad with zeros to 9: "000123456" → digits [0,0,0,1,2,3,4,5,6].
Key = [7,5,3,2,1,7,5,3,2].
Products position by position: 0×7=0, 0×5=0, 0×3=0, 1×2=2, 2×1=2, 3×7=21, 4×5=20, 5×3=15, 6×2=12.
weightedSum = 0+0+0+2+2+21+20+15+12 = 72.
72 × 10 = 720.
720 mod 11 = 720 − 65×11 = 720 − 715 = 5.
5 mod 10 = 5.
Control digit = 5; full CUI = 1234565 (VAT form RO1234565).The control digit is 5, giving the full CUI 1234565.
Edge cases
- The body is right-aligned against a fixed 9-element key and left-padded with zeros to 9 digits, so bodies shorter than 9 digits effectively use only the rightmost weights.
- The final `% 10` exists solely to map a modulo-11 remainder of 10 to the digit 0; all other remainders (0-9) pass through unchanged.
Gotchas
- The multiply-by-10 happens BEFORE the modulo 11 — it is (weightedSum × 10) % 11, not (weightedSum % 11) × something. Omitting the ×10 gives a different, wrong digit.
- `weightedSum` from number-tools is a bare Σ(digit×weight) with no modulus of its own; the modulus arithmetic is done inline in generate-cui-digits.ts, not by a mod11/mod10 primitive.
- The VAT form is just the literal prefix 'RO' + the CUI digits; the 'RO' plays no part in the checksum computation.
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 CUIs 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 national CUI (default) or RO VAT number. |
| invalid | boolean | Return a CUI with a deliberately wrong control 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 digit string incl. the control digit. |
Other generators for Romania
Romanian CNPRomanian companyRomanian company nameRomanian email addressRomanian IBANRomanian personRomanian person nameRomanian product or service offeringRomanian vehicle registration plate
See all generators for Romania →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 numberSlovak data · Slovak IČ DPHSlovak data · Slovak IČOSpanish data · Spanish CIFSwedish data · Swedish organisationsnummer
Try it