How Do You Read a Barcode (EAN-13)? How Is the Check Digit Calculated?
Updated: October 13, 2026 · AracMerkezi
The barcode scanned at a supermarket checkout is really just a number that identifies the product. The most common format in Turkey and Europe is EAN-13, a 13-digit code. The digits under the bars carry a verification mechanism of their own.
EAN-13 structure
The 13 digits consist of these parts:
- Prefix (first 2–3 digits): Indicates the numbering organization that allocated the code; for example, the prefix 869 is assigned to Turkey. This does not necessarily mean the country where the product was made; it shows the organization that issued the code.
- Company code: The number given to the manufacturer or brand.
- Product code: The number the manufacturer gives to the product.
- Check digit (last digit): The verification digit calculated from the previous 12 digits.
How is the check digit calculated?
The first 12 digits are given weights of 1 and 3 in turn, from left to right (1, 3, 1, 3 …). The products are added up; the number that brings the total up to the next multiple of ten is the check digit.
Example: 4006381333931
- First 12 digits: 4 0 0 6 3 8 1 3 3 3 9 3
- Weights: 1 3 1 3 1 3 1 3 1 3 1 3
- Products: 4, 0, 0, 18, 3, 24, 1, 9, 3, 9, 9, 9
- Total: 89
- Rounding up to the next multiple of ten: 90 − 89 = 1
- Since the last digit is 1, the barcode is valid.
To check this automatically, use the Barcode / EAN Checker tool. If the check digit is wrong, the tool also shows the correct value.
How does a barcode scanner catch errors?
The scanner performs the same calculation. A digit that is misread or mistyped by hand does not match the check digit, and the code is rejected. This method catches single-digit errors and most transposition errors; however, it does not guarantee catching every error.
How is a barcode created?
If you will use a barcode for your own product, you need to obtain a company prefix from the official numbering organization; generating a random number may clash with someone else's code. To generate a code for layout, testing, or internal inventory purposes, the EAN-13 Barcode Generator tool adds the check digit to a 12-digit code and produces it visually. For commercial sales, official registration is mandatory.
Relationship with ISBN
The international book number ISBN-13 is an EAN-13 that starts with the prefix 978 or 979; the barcode on a book's back cover shows the same number. The check digit is calculated with the same 1-3 weights.
Example: for 978030640615 the total is 93; 100 − 93 = 7 → 9780306406157. The older 10-digit ISBN-10 uses a different calculation based on 11. The ISBN Checker tool is available to check both.
Don't confuse it with the Luhn algorithm
Credit card numbers are validated with the Luhn algorithm: starting from the right, every second digit is multiplied by two, 9 is subtracted if the result is greater than 9, and the total is divided by 10. EAN-13 uses 1-3 weights instead. Both methods are simple typo checks; neither proves that a code is real or authorized. To check the format of a card number, there is the Credit Card Number Checker (Luhn) tool; don't enter real card numbers anywhere you don't trust.
Common mistakes
- Thinking the prefix is the “country of manufacture”; the prefix shows the organization that issued the code.
- Confusing the 12-digit UPC code with the 13-digit EAN; adding a 0 to the front of a UPC makes it an EAN-13.
- Assuming a barcode belongs to a real product just because the check digit is correct.
- Shrinking the barcode too much when printing, or printing it with low contrast; the scanner can't read it.
Printing tips
Print the barcode with black bars, a white background, and enough blank space around the edges. A blurry or skewed print leads to read errors. After printing, test it with a phone or a handheld scanner.
Summary
- EAN-13: 13 digits, prefix, company, product, and check digit.
- The check digit comes from a 1-3 weighted sum.
- A valid check digit does not show that the product is real; it only shows that the format is consistent.
Frequently asked questions
How is the EAN-13 check digit calculated?
The first 12 digits are given weights of 1 and 3 in turn, the products are added, and the total is rounded up to the next multiple of ten; the number that completes it is the check digit.
Are ISBN-13 and EAN-13 the same?
ISBN-13 is an EAN-13 that starts with 978 or 979, and its check digit is calculated with the same method.
Does a valid check digit prove the product is real?
No; it only shows that the number is formally consistent.
Tools mentioned in this guide
More guides
- What Is an ISBN? How to Check ISBN-10 and ISBN-13: Check Digit Guide – What is an ISBN and how do you read its 10- and 13-digit form? Check digit math, ISBN-10 to 13 conversion, the EAN-13 link and ISBNs in Turkey.
- What Is an IBAN? Structure and How to Validate It (Mod 97) – What is an IBAN and how is a Turkish IBAN structured? Step-by-step mod 97 validation with a real example, plus what the check does and does not catch.
- What Are Credit Card Numbers and the Luhn Algorithm? Step-by-Step Validation – How is a card number built? Learn the Luhn (mod 10) algorithm with worked examples, what it does and doesn't verify, security warnings and form tips.
- How to Calculate Percentages: Six Question Types, Formulas and Examples – Percentage math: percent of a number, what percent one is of another, increase and decrease, percentage points and reverse percentages, with examples.
- How to Calculate VAT: VAT-Inclusive and VAT-Exclusive Formulas and Examples – How do you separate VAT from a VAT-inclusive amount or add it to a VAT-exclusive one? Formulas, a mixed-rate invoice, rounding gaps and shortcuts.
This article is for general information only and is not legal, financial or medical advice. We are not an official institution.