FS TIN Algorithms Public
FS TIN Algorithms Public
Subject:
Table of Contents
1 Introduction.................................................................................................................................... 4
1.1 Objective of this Document..................................................................................................... 4
1.2 Applicative Issues................................................................................................................... 4
1.3 Intended Audience.................................................................................................................. 4
1.4 Structure of this Document..................................................................................................... 4
1.5 Related Documents................................................................................................................ 4
1.5.1 Reference Documents.................................................................................................... 4
1.5.2 Applicable Documents.................................................................................................... 4
1.6 Document Conventions.......................................................................................................... 5
1.7 Terminology............................................................................................................................ 5
1.7.1 Abbreviations and Acronyms.......................................................................................... 5
1.7.2 Definitions....................................................................................................................... 5
1.8 Versioning............................................................................................................................... 5
2 Scope............................................................................................................................................. 7
3 MS Specific Algorithms.................................................................................................................. 8
3.1 Austria.................................................................................................................................... 8
3.2 Belgium................................................................................................................................... 9
3.3 Bulgaria................................................................................................................................. 11
3.4 Croatia.................................................................................................................................. 12
3.5 Cyprus.................................................................................................................................. 13
3.6 Czech Republic..................................................................................................................... 14
3.7 Denmark............................................................................................................................... 16
3.8 Estonia.................................................................................................................................. 18
3.9 Finland.................................................................................................................................. 20
3.10 France................................................................................................................................... 22
3.11 Germany............................................................................................................................... 23
3.12 Greece.................................................................................................................................. 27
3.13 Hungary................................................................................................................................ 28
3.14 Ireland................................................................................................................................... 29
3.15 Italy....................................................................................................................................... 31
3.16 Latvia.................................................................................................................................... 33
3.17 Lithuania............................................................................................................................... 35
3.18 Luxembourg.......................................................................................................................... 37
3.19 Malta..................................................................................................................................... 40
3.20 Netherlands.......................................................................................................................... 41
3.21 Poland.................................................................................................................................. 42
3.22 Portugal................................................................................................................................ 45
3.23 Romania............................................................................................................................... 46
Page 2 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.24 Slovakia................................................................................................................................ 48
3.25 Slovenia................................................................................................................................ 49
3.26 Spain.................................................................................................................................... 50
3.27 Sweden................................................................................................................................. 52
3.28 United Kingdom.................................................................................................................... 56
Page 3 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
1 INTRODUCTION
1.1 OBJECTIVE OF THIS DOCUMENT
The aim of this document is to provide the Tax Identification Number (TIN) algorithms used to check
the validity of a TIN depending on a Member State (MS).
The Functional Specification (FS) are intentionally presented in a way that is appropriate for any
technical solution.
FITSDEV2-SC13-FS-
R01 ToW - Functional Specification 1.11 26/03/2013
ToW
VAT Number Construction Rules VIES-VAT Validation
R02 18.0.01 15/05/2017
Functional Description Routines-v18.0
Page 4 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
1.7 TERMINOLOGY
1.7.1 ABBREVIATIONS AND ACRONYMS
Acronym Meaning
1.7.2 DEFINITIONS
Definition Meaning
Table 4: Definitions
1.8 VERSIONING
The versioning of this document is based on major and minor numbers in the form x.y. These two
numbers are synchronized with the two first numbers of the TIN algorithms JAR version. Whenever a
functional change is needed in an algorithm, and the new version of the algorithm becomes less
restrictive than the previous one, the major number of this document is incremented. While an
algorithm needs some clarifications, but without requiring any modification in the implementations, or
when an algorithm becomes more restrictive the minor number of this document is incremented.
Page 5 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
In addition, a third number z is added at the end in case of documentation issue, which does not
change any algorithm except for clarification. This number is free and therefore not synchronized with
the TIN algorithms JAR version.
For example, if a country decides to extend the length of all its TIN by prefixing them by one character,
while still authorising the previous numbers the algorithm become less restrictive. This means that
countries that are still using the previous version of the algorithm will "block" TINs that are valid
according to the new rules. In such a case, the major number of this document release number will be
incremented.
Page 6 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
2 SCOPE
TIN-on-the-Web (ToW) must provide any person that has a Web access with the ability to check the
validity of a Tax Identification Number (TIN).
The end-user specifies the TIN. The validation is done by checking the syntax correctness of the TIN,
depending on the MS algorithm(s).
The goal of this document is to fully specify the MS algorithms to be used by the TIN validation
process of ToW.
Page 7 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3 MS SPECIFIC ALGORITHMS
Important preliminary remark: when querying a TIN, the user should not be requested to ask which
algorithm is applicable but (s)he must be able to just put the TIN and the check module will validate
the TIN against the algorithm(s); if one of the algorithm(s) is correct, then the result must be that the
TIN is valid.
3.1 AUSTRIA
Structure: TIN Format [C1, C2,"-", C3, C4, C5, “/”, C6, C7, Where C1 to C9 are characters
C8, C9] and C1 and C2 are separated
from the rest by a hyphen and C3
to C5 are separated from C6 to C9
by a slash.
Note: the hyphen and the slash
are not mandatory in all cases
(e.g. for IT processing, hyphen
and slash should be omitted).
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9
Structure: Special Characters If any, special characters (dash, slash or other signs) should be skipped.
Page 8 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.2 BELGIUM
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C11 are characters.
C9, C10, C11]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11
Structure: Special Characters If any, special characters (dash, slash or other signs) should be skipped.
Syntax: Check Digit C10, C11 1. Get the remainder of the division by 97 of the
number composed by C1, C2, C3, C4, C5, C6, C7,
C8 and C9;
2. 97 - remainder of the previous division is the check
number.
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C11 are characters.
C9, C10, C11]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11
Structure: Special Characters If any, special characters (dash, slash or other signs) should be skipped.
Page 9 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Syntax: Check Digit C10, C11 1. Get the remainder of the division by 97 of the
number composed by number 2 and C1, C2, C3,
C4, C5, C6, C7, C8 and C9;
2. 97 - remainder of the previous division is the check
number.
Page 10 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.3 BULGARIA
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C10 are characters.
C9, C10]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10
Syntax: Check Digit C10 1. Multiply the values of each position by the
corresponding weight:
C1 2
C2 4
C3 8
C4 5
C5 10
C6 9
C7 7
C8 3
C9 6
2. Add up the results of the above multiplications;
3. Get modulo 11 of the result of the previous
addition;
4. Check digit = remainder if remainder < 10
Check digit = 0 if remainder = 10.
Page 11 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.4 CROATIA
Structure: TIN [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, Where C1 to C11 are characters.
Format C11]
Structure: C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, A numeric.
Range C11
Structure: C1, C2, C3, C4, C5, C6, C7, C8, C9, C10 Random number.
Rules
C11 Check digit by the international standard
ISO 7064 (MOD 11, 10).
1 9 9+10=19 9 9*2=18 7
2 4 4+7=11 1 1*2=2 2
3 5 5+2=7 7 7*2=14 3
4 7 7+3=10 10 10*2=20 9
5 7 7+9=16 6 6*2=12 1
6 4 4+1=5 5 5*2=10 10
7 0 0+10=10 10 10*2=20 9
8 3 3+9=12 2 2*2=4 4
9 1 1+4=5 5 5*2=10 10
10 9 9+10=19 9 9*2=18 7
Page 12 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Page 13 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.5 CYPRUS
Structure: TIN Format [C1, C2, C3, C4, C5, C6, Where C1 to C9 are characters.
C7, C8, C9]
C9 A capital letter.
99652156X 1. 9 + 5 + 1 + 6 = 21;
2. 21 + 15 + 5 + 13 = 54;
3. 21 + 54 = 75;
4. 75 MOD 26 = 23;
5. 23 + 65 = 88 = X.
Page 14 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, C9 A numeric.
Structure: Special If any, special characters (slash) between C6 and C7 should be skipped; it
Characters is purely optional.
C3, C4 Month (in the range 1...12 for male) or month + 50 (in the
range 51…62 for female).
Structure: TIN Format [C1, C2, C3, C4, C5, C6, ["/"], C7, C8, Where C1 to C10 are
C9, C10] characters.
YYMMDD999C - 1 block of 10
digits issued for people born
after 1.1.1954.
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, C9, A numeric.
C10
Structure: Rules C1, C2 Two last digits of a year: Must be within the range:
00 - last two digits of current year for people born in
2000 and later;
54 - 99 for people born between 1954 and 1999.
C3, C4 Month (in the range 1...12 only for male) or month + 20
(in the range 21…32 only for male) or month + 50 (in the
range 51...62 only for female) or month + 70 (in the
range 71…82 only for female).
Page 15 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Page 16 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.7 DENMARK
Structure: TIN Format [C1, C2, C3, C4, C5, C6, “-“, C7, Where C1 to C10 are characters.
C8, C9, C10]
C1 to C6 are separated from C7 to
C10 by a hyphen. This hyphen is
optional and should be skipped in
the validation.
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10
Structure: Rules C1, C2 Day of month (in the range 1...31 depending on month
and year).
Syntax: Check Digit C10 1. Multiply the values of each position by the
corresponding weight:
C1 4
C2 3
C3 2
C4 7
C5 6
C6 5
C7 4
C8 3
C9 2
2. Add up the results of the above multiplications;
3. Get modulo 11 of the result of the previous addition.
The remainder must not be 1;
4. Check digit = 11 – remainder, or check digit = 0 if
the result of the modulo operation of the third step is
0.
Syntax: Additional Rules on Several ranges of figures are not possible and should be reported as
Check Digit erroneous if a TIN is checked in those ranges:
Page 17 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Page 18 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.8 ESTONIA
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C11 are characters.
C9, C10, C11]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11
Syntax: Check Digit C11 1. Multiply the values of each position by the
corresponding weight:
C1 1
C2 2
C3 3
C4 4
C5 5
C6 6
C7 7
C8 8
C9 9
C10 1
2. Add up the results of the above multiplications;
3. Get modulo 11 of the result of the previous
addition;
4. Check digit:
a. If remainder is less than 10, the remainder is
the check digit;
b. If remainder is 10, use the following table
instead of the previous one:
C1 3
C2 4
C3 5
C4 6
C5 7
C6 8
C7 9
C8 1
C9 2
C10 3
If remainder is less than 10, the
remainder is the check digit;
If remainder is 10, the check digit is 0.
Page 19 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
32708101201 1.
2. 3 + 4 + 21 + 0 + 40 + 6 + 0 + 8 + 18 + 0 = 100;
3. Check digit: 100 MOD 11 = 1.
46304280206 1.
2. 4 + 12 + 9 + 0 + 20 + 12 + 56 + 0 + 18 + 0 = 131;
3. 131 MOD 11 = 10;
4.
5. 12 + 24 + 15 + 0 + 28 + 16 + 72 + 0 + 4 + 0 = 171;
6. Check digit: 171 MOD 11 = 6.
Page 20 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.9 FINLAND
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, C9, Where C1 to C11 are
C10, C11] characters.
Structure: Range C1, C2, C3, C4, C5, C6, C8, C9, C10 A numeric.
Structure: Rules C1, C2 Day of month (in the range 1...31 depending on
month and year).
C7 + , - or A
Note:
"+" (plus) means year of birth between 1800
and 1899;
"-" (minus) means years between 1900 and
1999;
"A" means 2000 and above.
The structure check should absolutely ensure that
one of the 3 characters is included in the TIN.
Syntax: Check Digit C11 1. Concatenate C1, C2, C3, C4, C5, C6, C8, C9,
C10 (warning: C7 is not part of the check digit);
2. Calculate the modulo 31 of the abovementioned
number;
3. The result of calculating modulo 31 will give as a
result a number, which will provide the check
mark through the following table:
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F
16 H
17 J
18 K
Page 21 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
19 L
20 M
21 N
22 P
23 R
24 S
25 T
26 U
27 V
28 W
29 X
30 Y
Syntax: Sample 131052-308T 1. 131052308;
2. 131052308 MOD 31 = 25;
3. Check character = T.
Page 22 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.10 FRANCE
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, C9, Where C1 to C13 are
C10, C11, C12, C13] characters.
Structure: Range C1, C2, C3, C4, C5, C6, C8, C9, C10, A numeric.
C11, C12, C13
Syntax: Check Digit C11, C12, C13 1. Concatenate C1, C2, C3, C4, C5, C6, C7, C8, C9,
C10;
2. Get modulo 511 of the result of the previous
result;
3. Check digit = remainder if remainder < 100, C11 =
0 (if remainder < 10, C11 = 0 and C12 = 0).
Page 23 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.11 GERMANY
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C11 are characters.
C9, C10, C11]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11
C1, C2, C3, One and only one mandatory duplicate value: one of
C4, C5, C6, the first ten digits is used twice (the recurrent digits
C7, C8, C9, don't have to be located at subsequent positions but
C10 they can be).
Syntax: Check Digit C11 1. Take C1 modulo 10. If result is 0, result is 10;
2. Multiply the result by 2;
3. Take modulo 11 of the result. This value is called
X;
4. Take modulo 10 of C2 + X. If result is 0, result is
10;
5. Multiply the result by 2;
6. Take modulo 11 of the result. This value is called
Y;
7. Apply steps 4, 5 and 6 in an analogue way for
digits C3 to C10. Consider that last value called
Z;
8. 11 - Z = check digit. If check digit = 10, replace it
by 0.
Page 24 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
19. (7 + 7) MOD 10 = 4;
20. 2 * 4 = 8;
21. 8 MOD 11 = 8;
22. (1 + 8) MOD 10 = 9;
23. 2 * 9 = 18;
24. 18 MOD 11 = 7;
25. (8 + 7) MOD 10 = 5;
26. 2 * 5 = 10;
27. 10 MOD 11 = 10;
28. (2 + 10) MOD 10 = 2;
29. 2 * 2 = 4;
30. 4 MOD 11 = 4;
31. Check digit = 11 - 4 = 7.
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C11 are characters.
C9, C10, C11]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11
C1, C2, C3, One and only one mandatory duplicate or triple value:
C4, C5, C6,
C7, C8, C9, One of the first ten digits is used twice (the
C10 recurrent digits do not have to be located at
subsequent positions but they can be);
One of the first ten digits is used tree times (only
two recurrent digits are allowed to be one after
another).
Page 25 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
2. 8 * 2 = 16;
3. 16 MOD 11 = 5;
4. (6 + 5) MOD 10 = 1;
5. 1 * 2 = 2;
6. 2 MOD 11 = 2;
7. (0 + 2) MOD 10 = 2;
8. 2 * 2 = 4;
9. 4 MOD 11 = 4;
10. (9 + 4) MOD 10 = 3;
11. 3 * 2 = 6;
12. 6 MOD 11 = 6;
13. (5 + 6) MOD 10 = 1;
14. 1 * 2 = 2;
15. 2 MOD 11 = 2;
16. (7 + 2) MOD 10 = 9;
17. 9 * 2 = 18;
18. 18 MOD 11 = 7;
19. (4 + 7) MOD 10 = 1;
20. 1 * 2 = 2;
21. 2 MOD 11 = 2;
22. (2 + 2) MOD 10 = 4;
23. 4 * 2 = 8;
24. 8 MOD 11 = 8;
25. (7 + 8) MOD 10 = 5;
26. 5 * 2 = 10;
27. 10 MOD 11 = 10;
28. (1 + 10) MOD 10 = 1;
29. 2 * 1 = 2;
30. 2 MOD 11 = 2;
31. Check digit = 11 - 2 = 9.
Page 26 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
52. 18 MOD 11 = 7;
53. (0 + 7) MOD 10 = 7;
54. 7 * 2 = 14;
55. 14 MOD 11 = 3;
56. (4 + 3) MOD 10 = 7;
57. 7 * 2 = 14;
58. 14 MOD 11 = 3;
59. (8 + 3) MOD 10 = 1;
60. 2 * 1 = 2;
61. 2 MOD 11 = 2;
62. Check digit = 11 - 2 = 9.
Page 27 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.12 GREECE
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C9 are characters.
C9]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9
Page 28 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.13 HUNGARY
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C10 are characters.
C9, C10]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10
Structure: Rules C1 8.
Syntax: Check Digit C10 1. Multiply the values of each position by the
corresponding weight:
C1 1
C2 2
C3 3
C4 4
C5 5
C6 6
C7 7
C8 8
C9 9
2. Add up the results of the above multiplications;
3. Get modulo 11 of the result of the previous
addition;
4. Check digit = remainder.
Page 29 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.14 IRELAND
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C9 are characters.
C9] C9 is optional.
Syntax: Check Digit 1. In reverse order, each digit is multiplied by a weight started at 2:
C7 2
C6 3
C5 4
C4 5
C3 6
C2 7
C1 8
LetterToNumber(C9) 9
2. LetterToNumber(C9) is based on the following mapping:
“A”=1, “B”=2, “C”=3, “D”=4, “E”=5, “F”=6, “G”=7, “H”=8, “I”=9
A “W” or absence of character in position 9 is allocated a numeric
value of 0.
3. Add up each result;
4. The remainder of the modulo 23 indicates the character position on
the alphabet according to the following mapping:
0=”W”, 1=”A”, 2=”B”, 3=”C”… 22=”V”
1234567TW 1. 0*9+1*8+2*7+3*6+4*5+5*4+6*3
+ 7 * 2 = 112;
2. 112 MOD 23 = 20 = T.
1234577W 1. 0*9+1*8+2*7+3*6+4*5+5*4+7*3
+ 7 * 2 = 115;
2. 112 MOD 23 = 0 = W.
1234577WW 1. 0*9+1*8+2*7+3*6+4*5+5*4+7*3
+ 7 * 2 = 115;
2. 112 MOD 23 = 0 = W.
Page 30 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
1234577IA 1. 1*9+1*8+2*7+3*6+4*5+5*4+7*3
+ 7 * 2 = 124;
2. 124 MOD 23 = 9 = I
Page 31 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.15 ITALY
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, C9, Where C1 to C16 are characters.
C10, C11, C12, C13, C14, C15, C16]
Structure: Range C1, C2, C3, C4, C5, C6, C9, C12, A letter (uppercase or lowercase).
C16
C10, C11 Day of month (in the range 1...31 for men) or day of
month + 40 (in the range 41...71 for women).
C7, C8, C10, When two or more individuals have the same fifteen
C11, C13, C14, alphanumeric character, one or more of the seven
C15 numerical characters are replaced, starting from the
right, according to correspondence shown in the
following table:
Page 32 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Syntax: Check Digit 1. Each of the first fifteen characters, depending on its relevant position
(even or odd), is converted into a numeric value, according to
correspondence shown in the tables below:
2. The numerical values thus determined are added together and their
sum is divided by 26. The check character (C16) is obtained by
converting the remainder of the division in the corresponding
alphabetic character according to the table below:
Page 33 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.16 LATVIA
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C11 are characters.
C9, C10, C11]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11
Structure: Rules C1, C2 Day of month (in the range 1...31 depending on month
and year.
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C11 are characters.
C9, C10, C11]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11
C2 Digit “2”
1
This algorithm is applicable as of 01/07/2017.
Page 34 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.17 LITHUANIA
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C11 are characters.
C9, C10, C11]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11
Page 35 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Syntax: Check Digit C11 1. Multiply the values of each position by the
corresponding weight:
C1 1
C2 2
C3 3
C4 4
C5 5
C6 6
C7 7
C8 8
C9 9
C10 1
2. Add up the results of the above multiplications;
3. Get modulo 11 of the result of the previous
addition;
4. C11 = remainder if remainder is not 10;
5. If remainder is 10, calculate a new check digit
with over corresponding weight:
C1 3
C2 4
C3 5
C4 6
C5 7
C6 8
C7 9
C8 1
C9 2
C10 3
6. Add up the results of the above multiplications;
7. Get modulo 11 of the result of the previous
addition;
8. C11 = remainder if remainder is not 10; if
remainder is 10, C11 = 0.
Page 36 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.18 LUXEMBOURG
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, C9, Where C1 to C13 are
C10, C11, C12, C13] characters.
Structure: Range C1, C2, C3, C4, C5, C6, C8, C9, C10, A numeric.
C11, C12, C13
Syntax: Check Digit C12 1. Multiply the values of each position by the
corresponding weight:
C1 2
C2 1
C3 2
C4 1
C5 2
C6 1
C7 2
C8 1
C9 2
C10 1
C11 2
C12 1
2. If the product of a doubling operation is > 9, sum
the digits of the product;
3. Add up the results of the above multiplications;
4. Get modulo 10 of the result of the previous
addition;
5. If remainder = 0, C12 is valid. Otherwise the TIN is
not valid.
1. Create an array n containing the individual C1 to
C13
C11 and C13 of the TIN (where ni = the value of the
corresponding C), taken from right to left:
Page 37 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
C12, C13 The TIN is only valid if the check digits of C12 and C13
are valid.
Page 38 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
2. c = 0;
3.
Page 39 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.19 MALTA
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8] Where C1 to C8 are characters.
C8 A letter.
Structure: Rule C8 M, G, A, P, L, H, B or Z.
Structure: Special Characters From an IT perspective, there should always be 8 characters. If the first 4
digits are omitted in the query, the result should anyway be reported in 8
characters by including leading zeros. E.g. when "199Z" or "34581M" is
queried, the results should be shown respectively as "0000199Z" and
"0034581M".
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C9 are characters.
C9]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9
Page 40 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.20 NETHERLANDS
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C9 are characters.
C9]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9
Page 41 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.21 POLAND
This algorithm is the same as the one used for this MS in VIES-VATValidationRoutines [R02].
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, C9, Where C1 to C10 are
C10] characters.
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, C9, A numeric.
C10
Structure: Format [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11] Where C1 to C11 are
characters.
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11 A numeric.
Structure: Rule C1 - C2 Stand for the last numbers of the year of birth.
C3 - C4 Stand for the month of birth. However for birthdates between 1900
and 1999 no change to C3 - C4 is made, for other birthdates:
Between 1800 and 1899: month field is increased by 80;
Between 2000 and 2099: month field is increased by 20;
Between 2100 and 2199: month field is increased by 40;
Page 42 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Syntax: Rule C11 1. Multiply the values of each position by the corresponding
weight:
C1 1
C2 3
C3 7
C4 9
C5 1
C6 3
C7 7
C8 9
C9 1
C10 3
2. Add up the last digits of the above multiplications results;
3. Value of the last digit of the sum deduct from 10. If this last digit
is 0, the TIN is invalid;
4. The result of subtraction is the check digit.
Page 43 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
* 7 = 0, 3 * 9 = 27, 6 * 1 = 6, 2 * 3 = 6;
3. 0 + 6 + 0 + 3 + 0 + 4 + 0 + 7 + 6 + 6 = 32;
4. 10 - 2 = 8;
5. Check digit = 8.
Page 44 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.22 PORTUGAL
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C9 are characters.
C9]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, C9 A numeric.
Page 45 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.23 ROMANIA
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C13 are characters.
C9, C10, C11, C12, C13]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11, C12, C13
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C13 are characters.
C9, C10, C11, C12, C13]
Page 46 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10, C11, C12, C13
Structure: Rules C1 9.
C2, C3, C4 0.
Page 47 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.24 SLOVAKIA
Structure: TIN Format [C1 C2 C3 C4 C5 C6 C7 C8 C9 Where C1 to C10 are digits.
C10]
Structure: Special Characters If there is slash between C6 and C7, it should be skipped.
Syntax: Check Digit C10 If the number consisting of the digits C1, C2 is lower
than 54, C10 might not be present.
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C10 are characters.
C9, C10]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10
Page 48 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.25 SLOVENIA
This algorithm is the same as the one used for this MS in VIES-VATValidationRoutines [R02].
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8] Where C1 to C8 are characters.
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8 A numeric.
Structure: Rules C1, C2, C3, C4, Must be between 1000000 and 9999999 included.
C5, C6, C7
Page 49 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.26 SPAIN
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C9 are characters.
C9]
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8 A numeric.
C9 A letter.
Structure: Special Characters From an IT perspective, there should always be 9 characters. If digits are
omitted in the query, the result should anyway be reported in 9 characters
by including leading zeros. E.g. 54237A should be understood as
00054237A and should not be blocking the check.
T R WA G M Y F P D X B N J Z S Q V H L C K E
Structure: TIN Format [C1,C2, C3, C4, C5, C6, C7, C8, Where C1 to C9 are characters.
C9]
Page 50 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Syntax: Check Digit C9 0. Replace the leading letter by the corresponding digit
and concatenate the result with the other characters:
X Y Z K L M
0 1 2 0 0 0
Page 51 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
3.27 SWEDEN
Structure: TIN Format [C1, C2, C3, C4, C5, C6, “-“, C7, Where C1 to C10 are characters.
C8, C9, C10] C1 to C6 must be separated from
C7 to C10 by a hyphen.
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10
Structure: Special Characters Hyphen is mandatory. The hyphen has an importance and will not be
skipped for the purpose of TIN validation.
Syntax: Check Digit C10 1. Multiply the values of each position by the
corresponding weight:
C1 2
C2 1
C3 2
C4 1
C5 2
C6 1
C7 2
C8 1
C9 2
2. Add up the results of the above multiplications.
NB: 12 is regarded as 1 + 2;
3. The unit digit in the sum of the digits is subtracted
from 10 and the result is the check digit. If the
resulting number is 10, the check digit is 0.
Structure: TIN Format [C1, C2, C3, C4, C5, C6, “-“, C7, C8, Where C1 to C10 are
C9, C10] characters. C1 to C6 must be
separated from C7 to C10 by a
hyphen.
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, C9, A numeric.
C10
Structure: Special Characters Hyphen is mandatory. The hyphen has an importance and will not be
skipped for the purpose of TIN validation.
Page 52 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Syntax: Check Digit C10 1. Multiply the values of each position by the
corresponding weight:
C1 2
C2 1
C3 2
C4 1
C5 2
C6 1
C7 2
C8 1
C9 2
2. Add up the results of the above multiplications. NB: 12
is regarded as 1 + 2;
3. The unit digit in the sum of the digits is subtracted from
10 and the result is the check digit. If the resulting
number is 10, the check digit is 0.
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C12 are characters
C9, C10, C11, C12] and written as a single block.
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, C9, A numeric.
C10, C11, C12
Page 53 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Syntax: Check Digit C12 1. Multiply the values of each position from C3 to
C11 by the corresponding weight:
C3 2
C4 1
C5 2
C6 1
C7 2
C8 1
C9 2
C10 1
C11 2
2. Add up the results of the above multiplications.
NB: 12 is regarded as 1 + 2;
3. The unit digit in the sum of the digits is
subtracted from 10 and the result is the check
digit. If the resulting number is 10, the check
digit is 0.
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C12 are characters
C9, C10, C11, C12] and written as a single block.
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, C9, A numeric.
C10, C11, C12
Page 54 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Syntax: Check Digit C12 1. Multiply the values of each position by the
corresponding weight:
C3 2
C4 1
C5 2
C6 1
C7 2
C8 1
C9 2
C10 1
C11 2
2. Add up the results of the above multiplications.
NB: 12 is regarded as 1 + 2;
3. The unit digit in the sum of the digits is
subtracted from 10 and the result is the check
digit. If the resulting number is 10, the check
digit is 0.
Page 55 of 56
DG TAXUD REF: FS-TIN Algorithms-Public
TIN Algorithms - Public - Functional Specification VER: 5.06.01
MS Specific Algorithms
Structure: Range C1, C2, C3, C4, C5, C6, C7, C8, A numeric.
C9, C10
Structure: TIN Format [C1, C2, C3, C4, C5, C6, C7, C8, Where C1 to C9 are characters.
C9]
C2 Must not be D, F, I, O, Q, U, V.
C9 Must be A, B, C, D or a whitespace.
Page 56 of 56