Skip to content

GTIN Check Digit Calculator

Work out or check the GS1 check digit of a UPC, EAN-13, EAN-8, GTIN-14, GLN or SSCC, with the 3-1 weighting shown digit by digit.

Calculator Details

Check digit:1See results ↓

Work out the check digit for a number, or check a full barcode number

Automatic picks the type from the number of digits (13 digits could also be a GLN: same rule, same check digit).

Digits only; spaces, dashes and brackets such as (01) are ignored.

Your Results

Check digit: 1

Check digit

1

Full number: 4006381333931

Weighted sum

89

89 + 1 = 90, a multiple of 10

Number type

GTIN-13 (EAN-13)

As a GTIN-14

04006381333931

Padded with leading zeros, as stored in databases and GS1-128 (01)

The GS1 check digit is 1: the weighted sum is 89, and 89 + 1 = 90, a multiple of 10. The full GTIN-13 (EAN-13) is 4006381333931.

Detailed Breakdown

3-1 weighting, digit by digit (left to right, check digit excluded)
PositionDigitWeightProduct
14× 14
20× 30
30× 10
46× 318
53× 13
68× 324
71× 11
83× 39
93× 13
103× 39
119× 19
123× 39

Sum = 89. Rows weighted × 3 are highlighted.

How This Calculator Works

How it's calculated

from the digit next to the check digit, going left: multiply by 3, 1, 3, 1, …

sum = Σ digit × weight

check digit = (10 − sum mod 10) mod 10

Your numbers: the weighted sum of 400638133393 is 89. 89 mod 10 = 9, so the check digit is (10 − 9) mod 10 = 1, and 89 + 1 = 90. This is GS1 General Specifications §7.9.1, the same rule for every GTIN, GLN and SSCC.

Frequently Asked Questions

How do I calculate a GTIN check digit?

Take the number without its check digit. Starting with the digit on the right, multiply the digits alternately by 3 and 1, and add up the products. The check digit is whatever brings that sum up to the next multiple of 10. For the EAN-13 body 400638133393 the sum is 89, so the check digit is 1 and the full number is 4006381333931.

Is the UPC check digit calculated the same way as the EAN-13?

Yes. A UPC-A is a 12-digit GTIN, and putting a 0 in front of it gives the same number as an EAN-13. Adding a leading zero doesn’t change the weighted sum, so the check digit is the same either way. The same rule also serves GTIN-8, GTIN-14, GLN and SSCC.

How is this different from the Luhn mod 10 check?

Both end with “make the total a multiple of 10”, but they weight digits differently. Luhn, used on card numbers, doubles every second digit and adds the digits of each product. GS1 multiplies by 3 and keeps the products whole. A number that passes one usually fails the other: 79927398713 passes Luhn but not the GS1 check.

Does a valid check digit mean the barcode is registered?

No. One number in ten passes the check by chance. A GTIN is only genuine when it starts with a GS1 Company Prefix licensed to the brand owner, which you can look up with GS1’s Verified by GS1 service. Retailers and marketplaces increasingly check this, so buy numbers from GS1, not from resellers.

How do I check the digit of a UPC-E?

A UPC-E is a UPC-A with zeros removed, and its check digit is the check digit of the full UPC-A. Choose UPC-E as the number type: the calculator expands it (for example 0425261 becomes 04210000526), computes the check digit (4) and shows both forms.

Why do some numbers start with (01) or (00)?

Those are GS1 Application Identifiers. (01) means a GTIN follows, written as 14 digits; (00) means an SSCC follows, 18 digits. They appear under GS1-128 barcodes on cartons and pallets. The calculator ignores a leading identifier in brackets, so you can paste the number as printed.

What is a GTIN-14 and how does it relate to a GTIN-13?

A GTIN-14 identifies a case or carton of a product. It is usually an indicator digit (1 to 8) followed by the first 12 digits of the item’s GTIN-13, with a new check digit, because changing the first digit changes the sum. Databases also store every GTIN as 14 digits by adding leading zeros, which keeps the check digit unchanged.

The standard GS1 mod 10 check digit (GS1 General Specifications Release 26.0, §7.9.1), the same rule for GTIN-8, GTIN-12 (UPC-A), GTIN-13 (EAN-13 and ISBN-13), GTIN-14, GLN and SSCC; UPC-E is checked through its UPC-A expansion (§5.2.2.4.2). A correct check digit only means the number is well formed: it doesn't mean the number was issued to a company or belongs to a real product, which only GS1 can confirm. Book, restricted-circulation and coupon prefixes are noted from the number's first digits. Not included: ISBN-10 (mod 11), the check characters of variable-length GS1 keys (GMN, GIAI), the price check digit for variable-weight items (§7.9.4), and scenario compare.

GTIN Check Digit Calculator: UPC, EAN-13, GTIN-14 and SSCC Check Digits

By FindMySum · Last reviewed

A GTIN check digit calculator works out the last digit of a product barcode number, or checks that a full number is correct. Every GTIN (the number under a UPC or EAN barcode), every GLN location number and every SSCC pallet code ends with a check digit computed by one rule from the GS1 General Specifications: weight the digits 3, 1, 3, 1 from the right, add them up, and pick the digit that brings the total to a multiple of ten. This page shows the weighting digit by digit, tells you which kind of number you entered, and runs in your browser. The worked example uses the default, the EAN-13 body 400638133393.

Where the check digit comes from

GS1, the organisation behind retail barcodes, defines the check digit in section 7.9.1 of its General Specifications. The rule is the same for all fixed-length numeric keys:

  1. Write down the number without its check digit.
  2. Starting with the rightmost digit, multiply the digits by 3, 1, 3, 1, and so on, moving left.
  3. Add up all the products.
  4. The check digit is the amount needed to reach the next multiple of ten: (10 − sum mod 10) mod 10. If the sum is already a multiple of ten, the check digit is 0.

Lining the weights up from the right is what lets one rule serve numbers of 8, 12, 13, 14 and 18 digits.

Worked example: an EAN-13

Take the default body 400638133393 (12 digits). From the right, the digits 3, 9, 3, 3, 3, 1, 8, 3, 6, 0, 0, 4 get the weights 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1:

  • 3 × 3 = 9, 9 × 1 = 9, 3 × 3 = 9, 3 × 1 = 3, 3 × 3 = 9, 1 × 1 = 1
  • 8 × 3 = 24, 3 × 1 = 3, 6 × 3 = 18, 0 × 1 = 0, 0 × 3 = 0, 4 × 1 = 4

The products add up to 89. The next multiple of ten is 90, so the check digit is 1 and the full EAN-13 is 4006381333931, the number printed under the barcode on a well-known brand of highlighter. Change any one of those thirteen digits and the check fails, which is how a till or a warehouse system knows to reject a mistyped code.

The kinds of numbers it covers

NumberDigitsTypical use
GTIN-8 (EAN-8)8Small packs where a full barcode won't fit
GTIN-12 (UPC-A)12Products sold in Canada and the United States
GTIN-13 (EAN-13)13Products elsewhere, and books (ISBN-13)
GTIN-1414Cases and cartons (ITF-14 barcodes)
GLN13Companies, stores and warehouse locations
SSCC18Individual pallets and shipping units

A UPC-A and an EAN-13 are the same family: put a 0 in front of a UPC-A and you have a valid EAN-13 with the same check digit. A UPC-E is a UPC-A with runs of zeros squeezed out for small packages; it is checked by expanding it back to the UPC-A first, which the calculator does when you pick UPC-E.

Using the calculator

Pick "Calculate the check digit" and paste the number without its last digit, or "Check a full number" and paste the whole thing. Spaces, dashes and a leading application identifier such as (01) or (00) are ignored, so you can copy a number straight from a label. Leave the type on Automatic unless the number is 13 digits and you mean a GLN rather than an EAN-13, or it is a UPC-E. The results also show the 14-digit form that product databases store, the UPC-E form of a UPC-A when one exists, and a note when the prefix means a book, a coupon or a restricted in-store number.

GS1 mod 10 versus Luhn

Card numbers, Canadian SINs and phone IMEIs use a different mod 10 scheme, the Luhn algorithm, which doubles every second digit and adds the digits of the results. The two are easy to confuse because both finish by rounding up to a multiple of ten, but they give different check digits for the same body. If a supplier's barcode keeps failing, check it isn't being run through a Luhn validator by mistake; the Luhn algorithm calculator handles card-style numbers.

Mistakes that get products rejected

Inventing numbers. A number with a correct check digit can still belong to someone else. Retailers and online marketplaces check the company prefix against GS1's registry, so get numbers from GS1 (in Canada, GS1 Canada) rather than from barcode resellers.

Dropping leading zeros. Spreadsheets love to turn 036000291452 into 36000291452. The check digit still passes when the zero comes back, but an 11-digit number isn't a valid key. Store GTINs as text.

Reusing a GTIN for a changed product. A new size, a new flavour or a bundle needs its own GTIN under GS1's allocation rules, even though the old number still passes the check.

Making a case code by changing the first digit. A GTIN-14 for a carton changes the indicator digit, which changes the sum, so the check digit must be recalculated rather than copied from the item's GTIN-13.

Once the number checks out, the barcode generator can draw it as an EAN-13, UPC-A or ITF-14 barcode. For working with remainders in general, see the modulo calculator.

More questions

Can I make up my own barcode numbers if the check digit is right?

You can make a number that passes the check, but it isn't yours to use on products you sell. Retailers, Amazon and Google Shopping match GTINs against the GS1 registry, and a number outside your licensed company prefix can be rejected or clash with someone else's product. Numbers starting with 2 (or 02 and 04 on a UPC) are reserved for in-store use, such as weighed deli items.

Why does the weighting start with 3 on the right instead of the left?

So that every GS1 key, from 8 to 18 digits, uses one rule. GS1 lines all keys up on the right, at the check digit, as if they were padded with leading zeros to 18 digits. Leading zeros add nothing to the sum, so an EAN-13 and the same number written as a 14-digit GTIN give the same check digit.

What errors does the GS1 check digit catch?

Every single wrong digit, because multiplying by 1 or 3 never maps two different digits to the same last digit of the product. It also catches most swaps of two neighbouring digits, except when the two digits differ by 5 (for example 1 and 6 swapped), because 3 × 5 = 15 ends in 5 just like 1 × 5. Scanners also read the bars twice, so real misreads are rare.

Is an ISBN the same thing as a GTIN?

A 13-digit ISBN is a GTIN-13 in the 978 or 979 prefix, so it has the same check digit rule and prints as an EAN-13 barcode. Older 10-digit ISBNs use a different, mod 11 check digit that can be X, so converting an ISBN-10 to an ISBN-13 means adding 978 at the front and recalculating the last digit.

Do I need a check digit for an SSCC on a pallet label?

Yes. The Serial Shipping Container Code is 18 digits: an extension digit, your GS1 company prefix, a serial reference and a check digit computed with the same 3-1 weighting. It is printed after the application identifier (00) in a GS1-128 barcode, and warehouse systems reject labels whose check digit is wrong.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy