The Check Digit: What It Is and How to Calculate It

Written and reviewed by
José Enrique Ochoa
Founder of Global Barcodes · 45+ years in product coding
The Check Digit: What It Is and How to Calculate It
In this article

    The last digit of an EAN-13, UPC, EAN-14 or GLN is not part of the product number itself. It is a check digit, calculated from all the other digits. It exists to catch mistakes.

    What the check digit does

    When a scanner reads a barcode, or a person types a number into a system, errors can happen: a misread bar, two digits swapped, a wrong key. The scanner or system recalculates the check digit from the other digits. If the result does not match the last digit, it knows the number is wrong and rejects it instead of recording the wrong product.

    How to calculate the EAN-13 check digit

    Take the first 12 digits of the number and follow these steps:

    1. Multiply the digits in odd positions (1st, 3rd, 5th…) by 1.
    2. Multiply the digits in even positions (2nd, 4th, 6th…) by 3.
    3. Add all the results.
    4. The check digit is the number you must add to that total to reach the next multiple of 10. If the total is already a multiple of 10, the check digit is 0.

    Worked example

    First 12 digits: 4 8 9 1 2 3 4 5 6 7 8 9

    Digit 4 8 9 1 2 3 4 5 6 7 8 9
    Weight 1 3 1 3 1 3 1 3 1 3 1 3
    Result 4 24 9 3 2 9 4 15 6 21 8 27

    Total: 4 + 24 + 9 + 3 + 2 + 9 + 4 + 15 + 6 + 21 + 8 + 27 = 132. The next multiple of 10 is 140, so the check digit is 8.

    The complete number is 489 1234 56789 8. (This is only an example to show the calculation.)

    Other barcode types

    The same method works for UPC-A, EAN-8, EAN-14 and GLN. The rule is simply that, counting from the right, the digit next to the check digit is always multiplied by 3, then 1, then 3, and so on.

    Why it matters for you

    • Amazon and other marketplaces validate the check digit. Entering only 12 digits, or a wrong last digit, produces an error.
    • Never “invent” the last digit when typing your barcode into a system: copy it from the number printed under the bars or from the files we send you.
    • A correct check digit does not mean the number is yours. It only proves the number is well formed. Ownership is a separate question.

    All the barcodes we deliver come with the check digit already calculated and verified. See our EAN-13 barcodes with the 489 prefix.

    Spotted a mistake, outdated information or a typo? Let us know and we’ll fix it

    We review every report. If we confirm the mistake, we correct the page and update its date.

    Free consultation · No obligation
    Any questions about your barcodes? Ask me.

    I’m José Enrique Ochoa and I have more than 45 years of experience in product coding. Tell me about your product and where you want to sell it, and I will tell you which barcodes you need.

    In this article
      Free consultation
      Which barcodes do your products need?

      Official barcodes with the Hong Kong 489 prefix, one-time payment and no annual fees. Free advice before you order.

      Mon–Fri 9:00–18:00 (HKT)

      Recently updated articles

      Keep reading

      Updated 28/11/2026
      Read article →
      Updated 28/11/2026
      Read article →
      WhatsApp Llamar