The EAN-8 barcode format is a compressed format of the EAN-13 barcode, only containing 7 digits plus one checksum digit, and is generally used in places where a fullsized EAN-13 barcode would not fit.
To calculate the parity, we use the same process as with the EAN-13 barcode. We first need add up the 7 digits of the barcode with the weighting applied. For the EAN-8 barcode, the weighting of each digit which is in an odd-numbered position is 1 and for even-numbered positions, the weighting is 3. To find the sum, we need to multiply each digit by its weighting before adding it together.
Once we have the weighted sum, we apply a modulo 10 to the weighted sum, which gets the remainder after applying a modulo of 10 to the weighted sum.
The parity is then 10 - (modulo 10 of the weighted sum).
Now that we have an 8 digit number, we can encode it.
Like EAN-13, we split up the 8 digits we need to print into two blocks of 4 with a guard bar at the beginning and end of the barcode and one in the middle of the barcode too. The end guard bars are encoded as 101, while the middle guard bar is 01010.
The main difference now is that the parity digit is included in the barcode itself, rather than used to change the encoding, so it is remarkably simpler to implement.
For first 4 digits (the left hand side of the barcode) are encoded with the following encoding, which are the same as the odd parity encodings for the left hand side of EAN-13:
0
0001101
1
0011001
2
0010011
3
0111101
4
0100011
5
0110001
6
0101111
7
0111011
8
0110111
9
0001011
The right hand side encodings (the last 4 digits) are the same as the right hand codings of EAN-13. The encodings are as follows: