Browse the guides

Use a GTIN check digit to catch a transcription error

Work through a GTIN-12 check digit, investigate a failed copy and keep arithmetic validation separate from product authenticity.

You have copied a barcode number into a food notebook, but one digit is difficult to read. A GTIN check digit can flag an inconsistency in that transcription. It cannot identify an unreadable food or prove that a package is genuine. Use it as one check on the copied characters.

Start with a confirmed GTIN format

Section 7.9.1 of the current GS1 General Specifications, release 26.0 gives the check-digit algorithm for fixed-length numeric GS1 data structures. The exercise below uses a complete GTIN-12 layout: eleven data digits followed by the check digit. It is not a rule for every number printed on food packaging.

Take the illustrative eleven-digit body 01234567890. This example does not assert that the completed number belongs to a real product or that anyone may assign it commercially. Preserve the initial zero.

Calculate the twelfth digit

For this 12-digit layout, count positions from the left of the eleven-digit body. The alternating weights start with 3 at position 1. Equivalently, start at the rightmost body digit with weight 3 and alternate 3 and 1 while moving left.

OperationWorkingResult
Add body positions 1, 3, 5, 7, 9 and 110 + 2 + 4 + 6 + 8 + 020
Apply their weight20 times 360
Add positions 2, 4, 6, 8 and 101 + 3 + 5 + 7 + 925
Combine the weighted groups60 + 2585
Subtract from the next equal or higher multiple of ten90 minus 855

The resulting illustrative GTIN-12 is 012345678905. If the weighted sum already ends in zero, the check digit is zero; do not append the two characters 10.

Investigate failure instead of manufacturing agreement

A copied value ending in 6 would fail this example because its first eleven digits produce 5. Recheck the complete package code and the transcription. Do not automatically replace the last digit: an earlier digit could be wrong instead. Keep the failed entry and the correction reason when updating your notebook.

A matching calculation is narrower than a confirmed identity. It does not demonstrate that every character was copied correctly, that a code is properly licensed, or that a database's flavor and nutrition values match your package. The check also says nothing about ingredients, allergens or food safety.

Once the package identity is established, try everyday label reading with Ingredi AI from the official App Store or official Google Play page. Keep the printed label available for checking. These download links do not imply that the app performs this checksum or authenticates products.

Sources

Compare labels