How to Use This Tool
Choose a symbology, type the digits without the last one, and the check digit is worked out and appended. Paste the full number instead and it is verified rather than replaced.
What the check digit is for
The final digit carries no product information. It is computed from the others: multiply them alternately by 1 and 3, add the results, and the check digit is whatever brings the total to the next multiple of ten.
For 400638133393 the weighted sum is 89, so the check digit is 1 and the full code is 4006381333931.
The point is failure behaviour. Without it, a misread digit produces a different valid-looking number and the till rings up the wrong product silently. With it, almost every misread breaks the arithmetic and the scanner simply refuses — a loud failure instead of a quiet one, which is nearly always the better design.
What it catches, and the one thing it misses
- Any single wrong digit — always caught, because changing one digit always changes the weighted sum.
- Most swapped adjacent digits — caught, because the two positions carry different weights.
- Adjacent digits differing by exactly 5 — missed. Swapping them changes the sum by 2×5×(3−1) = 20, a multiple of ten, so the check digit stays the same. It is the known blind spot of this scheme.
Real scanners do not rely on the check digit alone; the bar patterns themselves are constrained enough that a bad read usually fails before the arithmetic is reached. The check digit is the last line, not the only one.
Which symbology to use
- EAN-13 — the worldwide retail standard. 95 modules wide.
- UPC-A — 12 digits, used in North America. It is an EAN-13 with a leading zero, so every UPC-A is also a valid EAN-13 and scanners treat them interchangeably.
- EAN-8 — 67 modules, for packages too small for a full symbol. Numbers are allocated separately and sparingly, so it is not simply a shorter EAN-13.
The leading digits are a country or organisation prefix — 978 and 979 are books, 20 to 29 are reserved for in-store use and never leave the shop. Which prefix maps to which region is shown alongside the result.
An important caveat about using these commercially
This generates a valid symbol from whatever digits you give it. It does not, and cannot, allocate you a number. Retail barcode numbers are issued by GS1 to a registered company prefix, and inventing digits produces a barcode that scans perfectly and belongs to someone else — which retailers will reject and which can collide with a real product.
For internal use, testing, or the 20–29 in-store range, make up what you like. For anything going on a shelf, get a real number first.
