TR

Home / Guides / How Do You Read a Barcode (EAN-13)? How Is the Check Digit Calculated?

How Do You Read a Barcode (EAN-13)? How Is the Check Digit Calculated?

Updated: October 13, 2026 · AracMerkezi

▶ Open Barcode / EAN Checker

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:

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

  1. First 12 digits: 4 0 0 6 3 8 1 3 3 3 9 3
  2. Weights: 1 3 1 3 1 3 1 3 1 3 1 3
  3. Products: 4, 0, 0, 18, 3, 24, 1, 9, 3, 9, 9, 9
  4. Total: 89
  5. Rounding up to the next multiple of ten: 90 − 89 = 1
  6. 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

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

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

This article is for general information only and is not legal, financial or medical advice. We are not an official institution.