All free tools

Free tool · everyday

Barcode Check Digit

Verify the check digit on an EAN or UPC barcode.

Your input

Result

Enter 8, 12, 13 or 14 digits

Your result appears here.

Runs in your browser · Nothing is uploaded

Embed this on your site

Free to embed. The attribution link stays with the widget, and the calculator keeps working exactly as it does here.

<iframe src="https://thedigitalstash.net/embed/barcode-check-digit" title="The Digital Stash calculator" width="100%" height="720" style="border:0;max-width:100%" loading="lazy"></iframe>

Understanding the Barcode Check Digit

A barcode check digit is a single number added to the end of a product identification code. Its purpose is to detect common errors, such as a mistyped digit or a digit transposed during data entry. The EAN-13 and UPC-A symbologies utilise a mathematical algorithm to verify the integrity of the preceding digits. If the final digit does not match the result of this calculation, the barcode is invalid.

The Calculation Method

The calculation uses a weighted sum of the digits. For both EAN-13 and UPC-A, the sequence alternates between multiplying by three and multiplying by one.

  1. Starting from the rightmost digit (excluding the check digit itself), assign a weight of 3 to the first digit, 1 to the second, 3 to the third, and so on, moving towards the left.
  2. Multiply each digit by its assigned weight.
  3. Sum all the resulting products.
  4. Calculate the remainder of this sum when divided by 10 (the modulo 10 operation).
  5. Subtract this remainder from 10. The result is the check digit. If the remainder is 0, the check digit is 0.

A Worked Example

Consider a hypothetical 12-digit EAN code: 501234567890. We will calculate the 13th digit, which is the check digit.

Step 1: Assign weights (right to left, excluding the final digit) The digits are: 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.

  • Position 12 (digit 0): weight 3 = 0
  • Position 11 (digit 9): weight 1 = 9
  • Position 10 (digit 8): weight 3 = 24
  • Position 9 (digit 7): weight 1 = 7
  • Position 8 (digit 6): weight 3 = 18
  • Position 7 (digit 5): weight 1 = 5
  • Position 6 (digit 4): weight 3 = 12
  • Position 5 (digit 3): weight 1 = 3
  • Position 4 (digit 2): weight 3 = 6
  • Position 3 (digit 1): weight 1 = 1
  • Position 2 (digit 0): weight 3 = 0
  • Position 1 (digit 5): weight 1 = 5

Step 2: Sum the products 0 + 9 + 24 + 7 + 18 + 5 + 12 + 3 + 6 + 1 + 0 + 5 = 90.

Step 3: Determine the check digit Divide the sum by 10. The remainder of 90 divided by 10 is 0. Subtracting the remainder from 10 gives 10. In this calculation, if the result is 10, the check digit is 0. Therefore, the valid 13th digit is 0.

Interpreting the Results

When you use this tool, the result will indicate whether the provided sequence follows the mathematical rules of the symbology.

  • Valid: The check digit provided matches the check digit calculated from the sequence. This indicates that the barcode is mathematically consistent according to the standard algorithm.
  • Invalid: The check digit provided does not match the calculation. This suggests a typing error in the sequence or a corrupted barcode string.

It is important to note that a valid result only confirms that the number follows the expected format. It does not verify that the barcode is registered, that it belongs to a specific product, or that it is currently active in a retailer database.

Assumptions and Limits

This tool assumes the input adheres strictly to the EAN-13 or UPC-A standards. It does not perform checks for other symbologies, such as Code 128 or EAN-8. Furthermore, the tool operates on the assumption that the input string is meant to be a standard numeric barcode. If non-numeric characters are included, the tool will be unable to process the request.

The tool has a limit of one string at a time. It cannot validate bulk files or images of actual printed barcodes. It is a logic utility designed to process textual data strings.

Who This Tool Is Not For

This tool is not intended for organisations or individuals requiring a definitive proof of ownership or registration for a barcode. If you are a retailer or a brand owner who needs to determine if a barcode is authentic or linked to a specific company, you must consult the GS1 Global Registry or the relevant national database.

This tool is not for users trying to decode physical barcode images or for those working with proprietary or closed-loop inventory systems that do not use standard EAN or UPC formatting. It is a diagnostic aid for verifying the mathematical syntax of a numerical sequence and nothing more.

More tools like this