Generator · Italian data

Italian Partita IVA

Endpoint GET /v1/it/partita-iva

What it covers

Returns a valid Italian Partita IVA (business/VAT identifier) with a correct Luhn checksum. Use `format=vat` for the IT-prefixed EU VAT number. Set `invalid=true` for a Partita IVA with a deliberately wrong check digit.

How it’s calculated

The 11th digit of an Italian Partita IVA is a standard Luhn (mod-10) check digit computed over the first 10 payload digits.

Algorithm

  1. Take the 10 payload digits (positions 1-10, left to right). Leading zeros are significant and must be kept.
  2. Walk the payload from right to left. Start with a 'doubling' flag set to true, so the rightmost payload digit is the first digit doubled.
  3. For each digit: if the doubling flag is true, multiply the digit by 2, and if the result is greater than 9 subtract 9 from it (equivalent to summing its two decimal digits). If the doubling flag is false, use the digit unchanged.
  4. Add the resulting value to a running sum.
  5. Flip the doubling flag after each digit (so doubling alternates: rightmost doubled, next not, next doubled, ...).
  6. After processing all 10 digits, compute check = (10 - (sum mod 10)) mod 10. The outer mod 10 maps a remainder of 0 back to a check digit of 0.
  7. Append this single check digit as the 11th and final digit of the Partita IVA.

Worked example

Partita IVA with payload 1234567890 and check digit ? (i.e. 1234567890?)

Payload digits: 1 2 3 4 5 6 7 8 9 0. Process right to left, doubling the rightmost digit first.
Position 10, digit 0 (double): 0*2 = 0 -> 0
Position 9, digit 9 (keep): 9
Position 8, digit 8 (double): 8*2 = 16 -> 16-9 = 7
Position 7, digit 7 (keep): 7
Position 6, digit 6 (double): 6*2 = 12 -> 12-9 = 3
Position 5, digit 5 (keep): 5
Position 4, digit 4 (double): 4*2 = 8 -> 8
Position 3, digit 3 (keep): 3
Position 2, digit 2 (double): 2*2 = 4 -> 4
Position 1, digit 1 (keep): 1
Sum = 0+9+7+7+3+5+8+3+4+1 = 47
check = (10 - (47 mod 10)) mod 10 = (10 - 7) mod 10 = 3

The check digit is 3, so the full Partita IVA is 12345678903.

Edge cases

  • A payload that yields sum mod 10 == 0 produces a check digit of 0 (the outer '% 10' in (10 - (sum % 10)) % 10 maps the would-be 10 back to 0).
  • Payloads are drawn freely with leading zeros allowed and significant, so an all-zero payload 0000000000 is a valid input; its Luhn sum is 0 and its check digit is 0.

Gotchas

  • The doubling starts at the rightmost PAYLOAD digit because the check digit sits to its right; equivalently, in 1-indexed left-to-right terms over the 10-digit payload, the even positions (2,4,6,8,10) are the ones doubled.
  • Overflow on doubling uses the subtract-9 rule (value -= 9 when value > 9), which is identical to summing the two digits of the product; the generator passes no custom modulus or complement — it relies on the shared luhnCheckDigit exactly as-is.
  • The generator only computes/validates the mod-10 check digit and does not verify that the number belongs to a registered company; values are synthetic.

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 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 11-digit Partita IVA (default) or IT-prefixed VAT number.
invalidbooleanReturn a Partita IVA with a deliberately wrong Luhn check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe Partita IVA in the requested format (national or VAT).
digitsstringThe canonical, unprefixed 11-digit Partita IVA.

Other generators for Italy

See all generators for Italy →

The same kind of identifier elsewhere

Try it

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