EAN-13 Check Digit Calculator

Compute and verify the EAN-13 barcode check digit

How it is calculated

Each of the first 12 digits is multiplied by a weight that alternates 1, 3, 1, 3 … from the left (position 1 gets 1, position 2 gets 3, and so on). The products are added to a sum S, and the check digit is (10 − (S mod 10)) mod 10, i.e. the number that brings S up to the next multiple of 10 (0 if it is already one).

Enter 12 digits to get the check digit that completes the code, or 13 digits to also compare your last digit with the computed one and see Valid or Invalid. Spaces and hyphens are stripped; any input that does not contain exactly 12 or 13 digits gives no result.

Worked example

Take 4006381333931. The first 12 digits are 4 0 0 6 3 8 1 3 3 3 9 3. Weighted by 1,3,1,3…: 4 + 0 + 0 + 18 + 3 + 24 + 1 + 9 + 3 + 9 + 9 + 9 = 89. Then 89 mod 10 = 9 and 10 − 9 = 1, so the check digit is 1. The thirteenth digit you typed is also 1, so the status is Valid.

Try this example →

Common mistakes

  • Pasting a 12-digit UPC-A code and expecting its own check digit: the tool treats 12 digits as the first part of an EAN-13 and weights from the left as 1,3, so the result is for EAN-13, not the UPC-A digit.
  • Typing 13 digits that include a wrong last digit and reading the shown check digit as "your" digit: the shown value is the correct one, and the status tells you whether yours matched.
  • Entering 8-digit EAN-8 codes or 14-digit GTIN-14 codes: only 12 or 13 digits are accepted, so nothing is returned.
  • Assuming a Valid status means the product exists: it only means the digits are internally consistent, not that the code is registered.

About this calculator

This calculator applies the official EAN-13 / GS1 checksum algorithm: starting from the left, multiply each of the first 12 digits alternately by 1 and 3 (odd positions ×1, even positions ×3), sum the results, and take the check digit as the number that rounds that sum up to the next multiple of 10 — formally, (10 − (sum mod 10)) mod 10.

Every retail barcode — EAN-13, UPC-A (its 12-digit North American sibling), and ISBN-13 — uses this same weighted mod-10 scheme, which is why a single-digit typo or a smudged scanner read almost always gets caught before a wrong price rings up. Retailers, packaging designers, and inventory systems use it to generate valid new codes and to verify that an existing barcode wasn't mistyped or corrupted.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators