Methodology

Checksum methodology for VAT identifiers

This page documents common checksum families used by VAT identifiers. National implementations can vary; always verify registration status via official services.

MOD 97

Used for remainder-based schemes where a numeric representation is validated by modulo 97 constraints.

Concept

Rule
Valid when remainder matches a defined constant or derived check value
Inputs
Digits only, or alphanumeric mapped to digits (country-specific)
Output
Two-digit check (typical)

Diagram

N (normalized digits) r = N mod 97 compare r Note: some countries derive check digits as (97 - r) or validate against a constant.

Luhn family

Digit transform checksum: alternating weights with a “double then subtract 9” normalization for digits ≥ 10.

Algorithm sketch

Step
Traverse digits; double every second digit (direction depends on national rule)
Normalize
If doubled digit ≥ 10, subtract 9
Check
Sum mod 10 equals 0 (or equals control digit rule)

Weighted sums and control digits

Many identifiers use fixed weights multiplied by digits, then reduced by modulo arithmetic to produce a control digit or letter.

Example: MOD 23 control letter

Used by Spanish NIF/NIE: remainder of the numeric component determines a control letter from a fixed alphabet.

Index
i = n mod 23
Letter
alphabet[i]

Failure modes and what a checksum does not prove

Implementation notes (validator)

VAT-Scan implements checksum logic client-side where the algorithm is public and deterministic. For cases where national rules require external mapping tables or authority-held datasets, the validator reports structural validity only and directs users to VIES for official confirmation.