Generator · Danish data
Danish CVR
Endpoint GET /v1/dk/cvr
What it covers
Returns a valid Danish CVR (company identifier) with a correct mod-11 check digit. Use `format=vat` for the DK VAT number (`DK` + CVR). Set `invalid=true` for a CVR with a deliberately wrong check digit.
How it’s calculated
The Danish CVR company number's eighth digit is a weighted mod-11 check digit: the 11-complement of the weighted sum of the first seven digits, with the residue that would need a two-digit check treated as unissued.
Algorithm
- Take the seven payload digits d1..d7 of the CVR (the first is 1-9 for the common shape; the eighth position is the check digit to be computed).
- Multiply each payload digit by its position weight from the sequence 2, 7, 6, 5, 4, 3, 2 (d1x2, d2x7, d3x6, d4x5, d5x4, d6x3, d7x2).
- Add the seven products together to get the weighted sum S.
- Compute the remainder r = S mod 11.
- Compute the complement raw = 11 - r.
- If raw == 11, the check digit is 0.
- If raw == 10, this prefix has no valid single-digit check digit; it is treated as never issued and must be discarded (redraw a different payload).
- Otherwise the check digit is raw itself (a value 1..9).
- Append the check digit as the eighth digit to form the full 8-digit CVR. Equivalently, the full number satisfies (2,7,6,5,4,3,2,1)-weighted sum of all eight digits is congruent to 0 mod 11.
Worked example
CVR 1234567? (payload 1234567, check digit ?)
Payload digits: 1,2,3,4,5,6,7 with weights 2,7,6,5,4,3,2.
Products: 1x2=2, 2x7=14, 3x6=18, 4x5=20, 5x4=20, 6x3=18, 7x2=14.
Weighted sum S = 2+14+18+20+20+18+14 = 106.
r = 106 mod 11 = 106 - 99 = 7.
raw = 11 - 7 = 4 (not 10 and not 11, so the check digit is raw).
Check digit = 4.
Cross-check via full-number rule with weights 2,7,6,5,4,3,2,1: 106 + 4x1 = 110, and 110 mod 11 = 0.The check digit is 4, so the full CVR is 12345674.
Edge cases
- A payload whose complement raw equals 10 (i.e. S mod 11 == 1) has no single-digit check and is never issued; the generator redraws such prefixes rather than emitting them.
- When the complement raw equals 11 (i.e. S mod 11 == 0), the check digit is 0 — a valid CVR ending in 0.
- Leading-zero CVRs are valid: the first payload digit can be 0, which the generator's edge mode deliberately exercises since a numeric parse would silently drop the CVR to seven digits.
Gotchas
- The generator passes weights for the seven payload digits only (2,7,6,5,4,3,2), not the full eight-digit weight vector 2,7,6,5,4,3,2,1; the trailing weight-1 term is the check digit itself and appears only in the equivalent full-number validation rule.
- The overflow rule is the primitive's default 'invalid': raw 10 -> undefined (unissued, redraw) and raw 11 -> 0. This is not a mod-10 fold, so no check digit is ever silently coerced.
- CVR numbers carry no sex, century, or category encoding — the seven leading digits are effectively opaque, so the only structural constraint on a value is this mod-11 check digit.
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 CVRs 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 CVR (default) or DK VAT number. |
| invalid | boolean | Return a CVR with a deliberately wrong mod-11 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 8-digit CVR. |
Other generators for Denmark
Danish companyDanish company nameDanish CPRDanish email addressDanish IBANDanish personDanish person nameDanish product or service offeringDanish vehicle registration plate
See all generators for Denmark →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ČODutch 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