The last digit is a test, not data
Calculates the EAN-13, EAN-8 or UPC-A check digit and verifies whether a full barcode was entered correctly.
The final digit of a barcode carries no information about the product. It is arithmetic: a weighted sum of the digits before it, chosen so that the whole code adds up to a multiple of ten.
That single digit catches every single-digit error and most transpositions, which is exactly what happens when a code is typed by hand or read badly.
What this calculator shows
- The check digit and the complete code
- Whether a supplied full code passes the test
- The weighted sum behind the calculation and the first three digits
What to keep in mind
- Digits are weighted 3 and 1 alternately, counting from the right of the body of the code.
- The first three digits are the GS1 prefix. They identify the numbering organisation that issued the code, not necessarily where the product was made.
FAQs
How is the check digit calculated?
Multiply the digits alternately by 3 and 1 from the right, add them, and take whatever is needed to reach the next multiple of ten.
What do the first three digits mean?
They are the GS1 prefix of the issuing organisation. 460 to 469 is Russia, 400 to 440 Germany, 50 the United Kingdom — but a code says where it was registered, not where the goods were made.
What errors does it catch?
Every single wrong digit, and most swaps of neighbouring digits. Swapping a pair whose difference is five slips through, which is the one known blind spot.
Is EAN-13 the same as UPC-A?
Nearly. UPC-A is twelve digits and is an EAN-13 with a leading zero; the check digit arithmetic is identical.
Worked example
A thirteen-digit code
Input: 460123456789
Output: check digit 3, the full code 4601234567893
Note: The weighted sum is 117, and the next multiple of ten is 120 — three away. Change any single digit and the sum stops landing on a multiple of ten.