Find a mistyped barcode before matching stock lines
Keep the barcode as text and validate the expected length and check digit. Use the approved item master to confirm the match. Hold any failed or ambiguous identifier before comparing quantity.
What you need
For an inventory lead diagnosing differences after a barcode-based stock import.
- Original barcode strings and the identifier format your item master uses.
- An approved barcode-to-item table and a stock controller to review exceptions.
Validate the barcode before using it as an item reference
- Read the source field as text, including its leading zeros.
- Validate the expected digits and format. For a GTIN-13, calculate the final digit using GS1’s weights on the first 12.
- Check valid results against the item master. Hold invalid values and valid IDs with no unique item mapping.
Two look-alike numbers pass different checks
Synthetic data. These are illustrative codes for checksum testing, with an approved match only on the first row.
Scroll the table to see all columns.
| Input | Check digit | Next action |
|---|---|---|
| 2400000001232 | Matches | Confirm item in the master |
| 2400000001237 | Wrong digit | Ask for original scan |
| 24000000012A2 | Invalid character | Check the source export |
The weighted sum of the first 12 digits of the first row is 28. Adding 2 reaches the next multiple of 10.
What to hand over
Give the stock lead a code-validation report and a separate queue for failed or unrecognised identifiers.
Limitation. A valid check digit establishes format consistency. The item master or issuing source still determines what the code represents.
Next step
Bring several raw barcode strings and the matching item master rows.
Related guides
Sources
- GS1 Denmark’s check digit guidance (accessed 23 November 2026)