Check Digit Calculator
With this check digit calculator, you can confirm the integrity of a barcode. Whether you're trying to determine the last digit of the GTIN code or simply ensuring you didn't make a typo, all you need to do is spend a few seconds copying the code into our calculator. This barcode check digit calculator works for 8, 12, 13, 14, 17, 18-digit GTIN standards. If you want to know more about the algorithm behind the calculation (mod 10 check digit) or you simply want to understand what is a check digit, keep scrolling.
What is a check digit?
Check digits are used to spot human errors - if you are typing a number manually, especially a long one, you probably mistype it by adding an extra digit, omitting one, or changing the digits' order. Check digits are the digits computed by an algorithm that can inform you about these typing errors. They are widely used nowadays, e.g., in bank account numbers, ISSN and ISBN numbers, Universal Product Codes, and European Article Numbers which all adhere to GTIN standards.
What is GTIN?
GTIN stands for Global Trade Item Number - it's a unique identifier for trade items developed by
, an organization creating global business standards. The family of codes within the GTIN is:- GTIN-12 (UPC) is used primarily in North America; it may be shown in UPC-A, ITF-14, or GS1-128 barcodes;
- GTIN-13 (EAN-13) - mainly used in the item registration process in supermarkets;
- GTIN-8 (EAN-8) - shortened version of GTIN-13;
- GTIN-14 (EAN/UCC-128 or ITF-14) - used for traded goods. It may be created from GTIN-8, GTIN-12, or GTIN-13 by zero padding (adding zeros at the beginning to obtain 14 digits).
When we use names such as UPC (Universal Product Code) or EAN (European Article Number), we refer to the Global Trade Item Number because they are both examples of GTINs. So if you are looking for a UPC check digit calculator, our tool is doing its job.
The barcode choice depends on the application: e.g., books sold internationally usually have the GTIN-13 code. GTIN-8 may be used for chewing gum (space constraints - longer GTIN-13 may simply not fit). GTIN-12 is used mainly for trade items scanned at the point of sale, and GTIN-14 is used in wholesale shipments.
What do the numbers in the barcode mean?
So, what's the meaning of the digits in the barcode?
- GTIN-13 (EAN-13)
GTIN-13 = Country code + Manufacturer prefix + Product code + Check digit
The First 2 or 3 digits are known as
. Remember that it is not necessarily the products' country of origin but the country in which the manufacturer is registered and the barcode assigned.- GTIN-8 (EAN-8)
GTIN-8 = Country code + Product code
- GTIN-12 (UPC-12, UPC)
GTIN-12 = Manufacturers prefix + Product code + Check digit
- GTIN-14 (EAN/UCC-128 or ITF-14)
GTIN-14 = Quantity/Packaging Indicator + Manufacturer code + Product code + Check digit
- 1st digit is called a logistic variant, and it indicates a packaging level ( e.g., two-pack, case, pallet; however, no standards among countries exist).
- 2^{nd} to 13^{th} digit - a unique company prefix and an item reference number; these two components vary in length but sum up to 12 digits.
Check digits in all versions mentioned above are calculated from a standard modulo 10 formula. You'll find the explanation of that algorithm below.
Mod 10 check digits - formula
To calculate the check digit of, e.g., GTIN-8, you need to:
- Multiply the value of each position by the weight from the . In our case, the weights are equal to 1 and 3. So the first digit is multiplied by 3, the second by 1, the third by 3, etc.
ID key format | Digit positions | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GTIN-8 | $N_1$ | $N_2$ | $N_3$ | $N_4$ | $N_5$ | $N_6$ | $N_7$ | $N_8$ | |||||||||||
GTIN-12 | $N_1$ | $N_2$ | $N_3$ | $N_4$ | $N_5$ | $N_6$ | $N_7$ | $N_8$ | $N_9$ | $N_{10}$ | $N_{11}$ | $N_{12}$ | |||||||
GTIN-13 | $N_1$ | $N_2$ | $N_3$ | $N_4$ | $N_5$ | $N_6$ | $N_7$ | $N_8$ | $N_9$ | $N_{10}$ | $N_{11}$ | $N_{12}$ | $N_{13}$ | ||||||
GTIN-14 | $N_1$ | $N_2$ | $N_3$ | $N_4$ | $N_5$ | $N_6$ | $N_7$ | $N_8$ | $N_9$ | $N_{10}$ | $N_{11}$ | $N_{12}$ | $N_{13}$ | $N_{14}$ | |||||
GSIN | $N_1$ | $N_2$ | $N_3$ | $N_4$ | $N_5$ | $N_6$ | $N_7$ | $N_8$ | $N_9$ | $N_{10}$ | $N_{11}$ | $N_{12}$ | $N_{13}$ | $N_{14}$ | $N_{15}$ | $N_{16}$ | $N_{17}$ | ||
SSCC | $N_1$ | $N_2$ | $N_3$ | $N_4$ | $N_5$ | $N_6$ | $N_7$ | $N_8$ | $N_9$ | $N_{10}$ | $N_{11}$ | $N_{12}$ | $N_{13}$ | $N_{14}$ | $N_{15}$ | $N_{16}$ | $N_{17}$ | $N_{18}$ | |
Multiply by | $3$ | $1$ | $3$ | $1$ | $3$ | $1$ | $3$ | $1$ | $3$ | $1$ | $3$ | $1$ | $3$ | $1$ | $3$ | $1$ | $3$ | $1$ |
- Sum all these values.
- Subtract this sum from the nearest equal or higher multiple of ten. You can find this number at our round to the nearest ten calculator — the result is your check digit! It should be the same as the final digit of your barcode.
If you do not wish to do it that way, you can use the formula:
Where
- $w_{\mathrm{A}}$ and $w_{\mathrm{B}}$ — Proper weights;
- $N_1 + N_3 + N_5 + ... + N_m$ — Consecutive odd digits;
- $N_2 + N_4 + N_6 + ... + N_n$ — Consecutive even digits;
- $(...)\ \mathrm{mod}\ 10$ — The remainder after division of $(...)$ by $10$. You can find a detailed explanation of this mathematical operation at Omni's modulo calculator.
There is one essential condition to mention: if a $\mathrm{check\ digit}$ calculated from the above formula equals 10, then we need to change it to a 0 to obtain a digit, not a number.
Barcode check digits
In this barcode check digit calculator, we implemented checking the last digit in common GS1 barcodes:
- GTIN-8 (7 digits + check digit)
- GTIN-12 (11 digits + check digit)
- GTIN-13 (12 digits + check digit)
- GTIN-14 (13 digits + check digit)
- GSIN (Global Shipment Identification Number, 16 digits + check digit)
- SSCC (Serial Shipping Container Code, 17 digits + check digit)
This calculator has an informational purpose; we want to show you how the check digit is calculated according to the modulo 10 algorithm we introduced at the Luhn algorithm calculator. However, our tool doesn't check whether the barcode exists or is a valid number. The software that creates product codes verifies the code and its check digits.
How to use the check digit calculator - example
Let's check what the barcode check digit of the fictitious code 112345567809 is:
- Add all digits in even positions (digits in positions 2, 4, 6, 8, 10, and 12):
- Multiply the result by 3:
- Sum all digits in odd positions (digits in positions 1, 3, 5, 7, 9, and 11)
- Add the results of steps 2 and 3:
- Subtract it from the nearest equal or higher multiple of ten:
Here it is! Now you know what the check digit of the GTIN-13 code is. Try to find it yourself with our check digit calculator!