About EAN-13 barcodes
Introduction
EAN-13 (also known as GTIN-13) is a standardized barcode format that specifies a specific product, a specific manufacturer, and a packaging configuration. It also includes the country code. The EAN-13 standard is designed to ensure that each product has its own product identification. EAN-13 is the most widely used barcode worldwide. EAN stands for European Article Number. GTIN stands for Global Trade Item Number.
The meaning of the digits in a EAN-13 barcode

- The first two or three digits represent the country code.
- The first 7 digits, including the country code, are called the GS1 prefix, for example, the manufacturer code.
- The GS1 prefix consists of 7 digits where the first 2 or 3 digits are the country code, and the remaining digits form the company identification. This may vary per GS1 region.
- The remaining digits (7 digits), excluding the last one, are called the item reference number.
- The last digit is the check digit (modulo 10 check character).
Verifying the correctness of a EAN-13 barcode
The computer performs a specific calculation on the barcode to check if it is correct. Let’s take the barcode from the image below as an example:

The barcode as written is: 8 7 1 1 2 0 0 4 3 1 6 3 2.
Step 1
If the number is 13 digits long, remove the last digit, as this is the modulo check digit. If it is 12 digits long, nothing needs to be removed. In this case, we have a 13-digit barcode, so we split it into two categories and proceed with the 12-digit version.
The 12-digit barcode is 871120043163. The check digit is 2.
Step 2
Add up all the digits in odd positions:
(8 + 1 + 2 + 0 + 3 + 6) = 20 Step 3
Add up all the digits in even positions and multiply the total by 3:
(7 + 1 + 0 + 4 + 1 + 3) × 3 = 16 × 3 = 48 Step 4
Add both results together:
20 + 48 = 68 Step 5
Divide this number by 10 and take the remainder:
68 / 10 = 6 remainder 8 Step 6
Check if the check digit is correct:
- If the sum of the remainder and the check digit equals 10, then the barcode is correct.
- Also, if the remainder is 0 and the check digit is also 0, the barcode is correct (since the sum is divisible by 10).
In this case, the remainder is 8 + check digit 2 = 10, so the barcode is correct.
If the barcode did not contain a check digit (thus only 12 digits), then the final result without a remainder must be divisible by 10. The remainder must then be 0.
An easier way to check if a barcode is correct is to add the last digit (check digit) to the remainder and see if that equals 10.
How a EAN-13 barcode works when scanning

When a EAN-13 barcode is scanned by a laser, the laser sees 59 bits (zeros and ones) distributed across the barcode. The black stripes in each segment represent a 1, and an empty line represents a 0. The black stripes do not reflect light, while the white stripes do reflect light.
The barcode divides these 59 bits into bit patterns that correspond to 15 digits:
- The first column is called the left guard.
- The middle (8th column) is called the center guard.
- The last column is called the right guard.
- A digit on the left side before the center guard is encoded with a bit pattern that always starts with 0 and ends with 1.
- A digit on the right side after the center guard starts with 1 and ends with 0.
So if a digit 5 is on the left side, the bit code is 0110001. If the same digit 5 is on the right side, the bit code is 1001110.
Based on the starting and ending digit in the bit pattern, the computer knows whether it is reading from left to right or from right to left.
EAN-13 standard format in the Netherlands
The standard format (100%) is 37.29 mm wide and 25.93 mm high (including the white spaces and the numbers below the barcode). The allowed enlargement factors are a minimum of 80% and a maximum of 200% of the standard format.