The country codes are naturally in public domain and available on Internet. One peculiarity is worth a mention: In order to embed the standard ISBN-10 into EAN-13, a country without borders (but also without territory) has been brought into play. The ISBN Bookland has received the country code of 978 so that, for example, an ISBN code 0-14-200057-4 is converted into EAN-13's 9780142000571. The difference in the last (check) digit is due to the difference of the applied algorithms.
The check digit algorithm in EAN-13 works almost in the same manner as in UPC-A. However, the twelfth digit, i.e. the one next to the check digit, is declared odd. All other odd digits are obtained from this one by moving leftward and counting each other digit. This is done in order to smoothly incorporate UPC-A as a whole without the need to modify its check digit.
Thus for a valid 13-digit EAN code d1d2d3...d13, we have
In the applet below, the first twelve digits of the code are clickable and modifiable. The last digit is calculated automatically according to (1).