Generate the check digit for an EAN-13, EAN-8, UPC-A, UPC-E, or GTIN-14 barcode, or verify that a full code is correct. The check digit is a single decimal computed with the GS1 mod-10 weighted-sum — it catches every single-digit error and most two-digit transpositions.
From the right, digits alternate weights of 3 and 1 (the check position is weight 0, computed last). Sum the weighted digits; the check digit is whatever brings that sum up to the next multiple of 10.
A schematic bar pattern for the current EAN-13 code — not a print-ready scannable barcode, but a quick visual sanity check that the digits line up. UPC-A is encoded as 0-prefixed EAN-13.
Paste one code per line — mixed formats are auto-detected by length. Useful for sanity-checking a SKU export or supplier feed.
Every GS1 barcode (EAN-13, EAN-8, UPC-A, UPC-E, GTIN-14, ITF-14, SSCC-18, GLN-13) ends with a single decimal check digit. Starting from the digit immediately left of the check position and moving leftward, digits are weighted alternately 3, 1, 3, 1, …. The check digit is (10 − (weighted sum mod 10)) mod 10. This is the same mod-10 scheme used by the global GS1 standard since 1973 — not to be confused with the Luhn algorithm (which credit cards use, alternating ×2 and ×1 from the right).
The check digit catches 100% of single-digit substitutions and roughly 89% of adjacent transpositions. Transpositions of digits where the difference between them is 5 (e.g. 49 ↔ 94) are not caught — this is the well-known weak spot of the algorithm.