Generator · Lithuanian data

Lithuanian PVM (VAT) number

Endpoint GET /v1/lt/pvm

What it covers

Returns a valid Lithuanian PVM mokėtojo kodas (VAT identification number) with a correct two-pass mod-11 check digit. Use `format=vat` for the `LT`-prefixed form. Set `invalid=true` for a PVM number with a deliberately wrong check digit.

How it’s calculated

The 9th digit of a Lithuanian PVM mokėtojo kodas (VAT payer code) is a two-pass ISO 7064-style mod-11 check digit computed over the 8 payload digits, whose 8th position is a fixed marker of 1.

Algorithm

  1. Start from an 8-digit payload d1 d2 ... d8 (indices 0..7). Positions 1-7 are the identifying digits; position 8 (index 7) is always the fixed marker digit 1 for the 9-digit legal-entity form.
  2. Define the first-pass weights: weights1[i] = 1 + (i mod 9) for i = 0..7. Because i only reaches 7, this evaluates to [1, 2, 3, 4, 5, 6, 7, 8].
  3. Compute the first weighted sum S1 = sum over i of ( payload[i] * weights1[i] ).
  4. Compute r1 = S1 mod 11.
  5. If r1 < 10, the check digit is r1. Stop.
  6. Otherwise (r1 == 10), define the second-pass weights: weights2[i] = 1 + ((i + 2) mod 9) for i = 0..7, which evaluates to [3, 4, 5, 6, 7, 8, 9, 1].
  7. Compute the second weighted sum S2 = sum over i of ( payload[i] * weights2[i] ), and r2 = S2 mod 11.
  8. If r2 < 10, the check digit is r2. Otherwise (r2 == 10) the check digit is 0.
  9. Append the resulting single check digit to the payload to form the 9-digit PVM code. For the LT VAT presentation, prefix the literal 'LT' to the 9 digits.

Worked example

PVM payload 1234567 with fixed marker 1 → 12345671?

Payload digits (index 0..7): [1, 2, 3, 4, 5, 6, 7, 1] — note the last digit is the fixed marker 1.
weights1 = [1, 2, 3, 4, 5, 6, 7, 8].
S1 = 1*1 + 2*2 + 3*3 + 4*4 + 5*5 + 6*6 + 7*7 + 1*8 = 1 + 4 + 9 + 16 + 25 + 36 + 49 + 8 = 148.
r1 = 148 mod 11 = 5 (since 11*13 = 143, 148 - 143 = 5).
r1 = 5 < 10, so the check digit is 5. No second pass needed.
Full 9-digit code: 123456715 (VAT form: LT123456715).

The check digit is 5, giving the full PVM code 123456715 (LT123456715).

Edge cases

  • zero-check-digit corner: when the two-pass computation yields 0 (either r1 or r2 equals 0, or both passes overflow to residue 10 giving a forced 0), the 9th digit is 0 — a valid value naive filters sometimes reject.
  • repeated-pattern corner: the first seven payload digits can legitimately all be the same digit (e.g. 1111111 then marker 1), which still produces a valid check digit despite looking like a placeholder.
  • Double-overflow: if both passes produce residue 10, the check digit is forced to 0 rather than being unissued — this scheme never rejects a payload, so the generator never has to redraw.

Gotchas

  • The 8th digit (index 7) is not free: this generator always fixes it to the marker 1, identifying the 9-digit legal-entity form. It participates in the weighted sum with weight 8 (pass 1) / weight 1 (pass 2).
  • The two passes use DIFFERENT weight vectors, not merely a re-run: pass 2 shifts the cycle by 2 (weights2[i] = 1 + ((i+2) mod 9)), yielding [3,4,5,6,7,8,9,1], and is only invoked when pass 1's residue is exactly 10.
  • The check digit is a pure single digit 0-9 and is fully determined by the 8 payload digits; corrupting it by adding 1..9 mod 10 always produces an invalid number (the corrupt path).

Parameters

ParameterTypeDescription
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 valid edge-case PVM numbers from the rare corners.
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.
format"national" | "vat"Rendering: bare 9-digit PVM number (default) or LT-prefixed VAT number.
invalidbooleanReturn a PVM number with a deliberately wrong check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe PVM number in the requested format (national or LT-prefixed VAT).
digitsstringThe canonical, unprefixed 9-digit PVM number.

Other generators for Lithuania

See all generators for Lithuania →

The same kind of identifier elsewhere

Try it

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