Skip to the content
UPC Generator

What is a check digit?

A check digit is the last digit of a number, worked out from all the digits before it. It lets a machine tell a mistyped number from a real one. The retail scheme on every UPC and EAN catches any single wrong digit. It cannot see two neighbors swapped when they differ by 5, which is about one adjacent swap in nine.

By the UPC Generator team. The sums come from the GS1 General Specifications, Release 26.0, GS1's own check digit page and the ISBN Users' Manual. Wikipedia's articles on check digits, the Luhn algorithm and bank routing numbers cover the other schemes. Every worked number is recomputed by the same code as the check digit calculator. Last updated 4 November 2026. How UPC Generator pages are made.

The digits of 629104150021 with their weights and products laid out in three rows, adding up to 57
GS1's own example worked in three rows.

What it is for

Numbers get mistyped, misread and misheard. GS1 says the check digit at the end of a UPC, EAN or GTIN exists to detect and reject incorrectly composed values. The example it gives is someone keying a number by hand. A barcode reader repeats the sum on every read and, as GS1 puts it, carries out that verification automatically. Seagull Scientific's BarTender help describes the failure case plainly: if the recomputed digit does not match, the scanner sends nothing and you scan again.

The digit exists to catch typos, and it gives no security. Any 11 digits can be given a valid twelfth. So a correct check digit says nothing about whether a product exists or whether the number is licensed to anyone. The check digit tool will complete any 11 digits you give it, and a scanner will accept any 12 digits whose last digit fits. A valid digit is never proof that a number is real or licensed. A made-up number must never be passed off as a product's own.

The retail sum

GS1 uses one calculation for every fixed length number in its system, from the 8 digit EAN-8 to the 18 digit shipping container code. Starting from the digit next to the check digit, multiply the digits alternately by 3 and 1. Then add the products, and subtract the total from the next multiple of ten. The difference is the check digit.

GS1's own example is the 12 digit body 629104150021. The weighted products are 6, 6, 9, 3, 0, 12, 1, 15, 0, 0, 2 and 3, which add up to 57. The next multiple of ten is 60, so the check digit is 3 and the number is 6291041500213. Wikipedia works the same sum on a UPC-A. For 036000241457 the digits in the odd positions add up to 14, which times 3 is 42, and the even positions add up to 11. The total is 53, and the check digit is 7.

In the bars of a UPC-A or EAN-13 the check digit is the rightmost pattern before the end guard. A UPC-E has no room for it. So GS1 carries it in the choice of odd and even patterns for the six digits that are drawn.

What the retail sum catches and misses

Because the weights 3 and 1 share no factor with 10, changing any single digit always changes the sum, so every single-digit error is caught. Swapping two neighbors is different. The swap changes the sum by twice the difference between the two digits. When that difference is 5 the change is a multiple of 10, which the sum cannot see. So the pairs 0 and 5, 1 and 6, 2 and 7, 3 and 8, and 4 and 9 can trade places without the scanner noticing. That is 10 of the 90 possible swaps of two different digits, about 11 percent. This is why Wikipedia puts the scheme's catch rate on swaps at around 90 percent. Type 16 as 61 in the middle of a UPC and the check digit still passes.

The other check digits you meet

Other check digits and what each one misses
Number How the check digit is worked out What it misses
UPC, EAN, GTIN, SSCC GS1's sum with weights 3 and 1 Neighbors swapped when they differ by 5
ISBN-13 The same sum with weights 1 and 3, since an ISBN-13 is an EAN-13 The same swaps
ISBN-10, issued until 2006 Weights 10 down to 2, remainder on dividing by 11, a result of 10 written as X Catches every single error and every swap, at the cost of the X
Credit cards, IMEI numbers The Luhn algorithm: double every second digit from the right, subtract 9 from any result above 9, add up Only the swap of 0 and 9 next to each other
US bank routing numbers Weights 3, 7 and 1 repeated over the nine digits; the total must divide by 10 The same five pairs as the retail sum

The ISBN manual's example is 978-92-95055-12-4. The first 12 digits weighted by 1 and 3 add up to 126. The remainder on dividing by 10 is 6, and the check digit is 4. The routing number 111000025 passes. Three times the sum of the first, fourth and seventh digits is 3, and 7 times the second, fifth and eighth is 21. The third, sixth and ninth add up to 6, for a total of 30. The Luhn method was devised at IBM by Hans Peter Luhn in 1954 and is in the public domain.

Two later schemes, Verhoeff's from 1969 and Damm's from 2004, catch every single error and every adjacent swap with one digit. No barcode uses them. GS1's sum is simple enough to do by hand.

Finding or testing one

The check digit calculator adds a check digit to a number you have been given, or tests one you have read off a label. It shows the weighted products for each of ten number types, including UPC, EAN, GTIN-14, SSCC and both kinds of ISBN. For a UPC you are about to print, the UPC generator works out the digit as you type and flags a wrong one. If you want to know who holds a number rather than whether it is well formed, the guide to GTINs explains the GS1 lookup. A book's ISBN uses the same sum once it is written as an EAN-13, as ISBN barcode with a price shows.

More about check digits

Does a correct check digit prove a product is real?

No. Any 11 digits can be given a valid twelfth, so the digit only shows the number is well formed. Whether a number is licensed to a company is a different question, answered by GS1's Verified by GS1 lookup.

Where is the check digit in a UPC?

It is the last printed digit, and in the bars it is the rightmost pattern. In a UPC-E, the short code on small packs, the check digit is not drawn as its own symbol. GS1 says it is carried by the pattern of odd and even digits.

Why is an ISBN check digit sometimes an X?

That was the old 10 digit ISBN, which used a modulus 11 sum where the answer could be 10, written as X. Since 2007 ISBNs have 13 digits and use the same 1 and 3 weighting as a retail EAN. So the answer is always a single digit.

Do credit cards use the same check digit as barcodes?

No. Cards use the Luhn algorithm, which doubles every second digit, while barcodes use GS1's 3 and 1 weighting. Both catch every single wrong digit, and each misses a different set of swaps.

7 source documents

  1. Seagull Scientific: BarTender help: check digit, fetched 2 November 2026
  2. GS1: General Specifications, Release 26.0, sections 1.3.1, 2.1.3.1, 2.1.11.3, 5.2.2 and 7.9, fetched 2 November 2026
  3. GS1: How to calculate a check digit manually, fetched 2 November 2026
  4. International ISBN Agency: ISBN Users' Manual, 7th edition, Appendix 1, fetched 2 November 2026
  5. Wikipedia: Check digit, fetched 2 November 2026
  6. Wikipedia: Luhn algorithm, fetched 2 November 2026
  7. Wikipedia: ABA routing transit number, fetched 2 November 2026