Skip to content
๐Ÿงฎ

EAN-13 Check Digit Calculator: Formula and Working

Calculate or verify the check digit for EAN-13, EAN-8, UPC-A and ITF-14, and see the full working: every weight, every product, the sum and the final modulo step.

Built by Toolsque Team · last updated September 29, 2026 · checked against our testing process

How to calculate an EAN-13 check digit

  1. Pick the barcode type: EAN-13 is the usual retail barcode. Choose UPC-A for twelve digit American codes, EAN-8 for small packaging, ITF-14 for shipping cartons.
  2. Type your digits: enter twelve digits for an EAN-13 and the check digit is calculated. Enter all thirteen and it is verified instead.
  3. Read the answer: the check digit appears large, with your complete number underneath it and the new digit highlighted.
  4. Follow the working: the table below shows each digit, the weight applied to it and the product, then the sum and the final modulo step. That is the whole formula, on your own number.
  5. If you were verifying: a failed number tells you both the digit you have and the digit it should be, so you can correct a typo without starting again.

The EAN-13 check digit formula

The last digit of an EAN-13 is not part of the product number at all. It is a checksum worked out from the twelve digits in front of it, defined in the GS1 General Specifications. Its only purpose is to let a scanner prove it read the rest correctly.

The rule, in full:

  1. Take the payload, meaning the number without its check digit.
  2. Starting at the rightmost digit of that payload and working leftwards, multiply alternately by 3 and 1, beginning with 3.
  3. Add all the products together.
  4. The check digit is whatever you must add to reach the next multiple of ten, which is (10 minus sum mod 10) mod 10.

That second modulo matters. Without it a sum ending in zero gives you 10, which is not a digit. The correct answer in that case is 0.

A worked example

Take the payload 590123412345. Weighting from the right gives:

5×1 + 9×3 + 0×1 + 1×3 + 2×1 + 3×3 + 4×1 + 1×3 + 2×1 + 3×3 + 4×1 + 5×3

which is 5 + 27 + 0 + 3 + 2 + 9 + 4 + 3 + 2 + 9 + 4 + 15, giving 83. The next multiple of ten is 90, so the check digit is 7 and the complete number is 5901234123457.

Why starting from the right matters

Almost every wrong answer comes from weighting left to right instead. On an EAN-13 the payload is twelve digits, an even number, so both directions happen to produce the same alternating pattern and the mistake stays hidden.

On an EAN-8 the payload is seven digits, an odd number, so the two directions disagree and you get a digit that no scanner will accept. If your EAN-13s work but your EAN-8s do not, this is almost certainly why.

The same formula covers four barcode types

The weighting rule does not care how long the number is, which is why one calculation serves all of these:

  • EAN-8, seven digit payload, for packaging too small for a full barcode.
  • UPC-A, eleven digit payload, the twelve digit retail code used in the US and Canada.
  • EAN-13, twelve digit payload, the retail code used everywhere else.
  • ITF-14, thirteen digit payload, printed on the outer shipping carton rather than the product.

A UPC-A is also a valid EAN-13 with a leading zero, so the same number gives the same check digit either way.

A valid check digit is not a valid barcode

This is worth being blunt about. A correct check digit means the number is well formed. It says nothing about whether the number was ever issued to anyone. This page will happily calculate a check digit for twelve digits you invented, and the result will scan.

What decides whether a number is legitimately yours is the company prefix at the front, which GS1 licenses. You can see which organisation issued any prefix with our barcode country code lookup, and whether you need GS1 at all covers what that costs and why resold barcodes exist.

Reading a code rather than building one? Our barcode scanner decodes from a photo or your camera and runs this same check automatically. To generate the printable barcode itself, use the barcode generator. Developers can call all of it through the free GS1 API.

Generating a number rather than checking one

This page validates and calculates the final digit. To produce a scannable image, use the EAN-13 generator or, for US and Canadian products, the UPC-A generator. For other symbologies the multi format barcode generator covers Code 128 and ITF-14.

Frequently Asked Questions

What is the check digit on an EAN-13?

It is the thirteenth and final digit, and it is not part of the product number. It is calculated from the twelve digits before it. Its only job is to let a scanner prove it read the other twelve correctly, so a misread or a typo is caught instead of being accepted as a different product.

What is the formula for the EAN-13 check digit?

Take the first twelve digits. Working from the rightmost of those twelve leftwards, multiply alternately by 3 and 1, starting with 3. Add the results. The check digit is the number you must add to that sum to reach the next multiple of ten, which is (10 minus sum mod 10) mod 10.

Is the EAN-8 formula different from EAN-13?

No. The weighting rule is identical and it is length independent, which is why the same arithmetic covers EAN-8, UPC-A, EAN-13 and ITF-14. The only thing that changes is how many digits you start with.

Why does my check digit come out as 10?

It cannot. If your working gives 10, the final modulo step was missed. After subtracting the sum from the next multiple of ten you take the result mod 10 again, which turns 10 into 0. A check digit is always a single digit from 0 to 9.

Does a valid check digit mean the barcode is real?

No. It means the number is well formed, nothing more. Anyone can calculate a valid check digit for any twelve digits, which is exactly what this page does. Whether the number was ever issued to a company is a separate question, and the prefix is the place to start looking.

Which digit do I start weighting with?

Start with 3 on the rightmost digit of the payload, meaning the number without its check digit, and alternate leftwards. Counting from the left instead is the most common mistake, and it gives the wrong answer on odd length payloads.