notAcalculator logo

Check Digit Calculator

Validate GTIN-8, UPC-A, EAN-13, GTIN-14, SSCC-18, UPC-E and ISBN codes, or generate the check digit, with every weight and the sum shown step by step.

Check Digit Calculator

Give us your feedback! Was this useful?

Introduction

A check digit is a single extra character appended to an identification number so that a machine — or a person typing the number — can tell whether the rest of it is correct. The digit is derived from all the other digits, so changing any one of them, or swapping two adjacent ones, breaks the relationship and the code is rejected. That is why barcodes, shipping labels and books all end with a digit that looks arbitrary but is not: it is arithmetic.

This calculator handles the check-digit systems you meet outside of payment cards. It validates a complete code or generates the missing check digit for GS1 identifiers — GTIN-8, GTIN-12 (UPC-A), GTIN-13 (EAN-13), GTIN-14 (the ITF-14 shipping case) and SSCC-18 [gs1-sscc] — plus UPC-E, which is the compressed 8-digit form of a UPC-A, and the two ISBN formats, ISBN-10 and ISBN-13. Every calculation is shown with the individual weights and products, so you can follow the arithmetic instead of trusting a verdict. [gs1-genspecs]

Check digits do not make a number authentic; they make it internally consistent. A code that passes can still refer to a product that does not exist, and a code that fails is not necessarily counterfeit — it is simply mistyped, misprinted, or scanned badly. Treat the result as a typing and printing check, not as a provenance check.

Payment card numbers use a different scheme, the Luhn algorithm, which is covered by the Luhn Check Digit Calculator. The modulo arithmetic underneath both families is the same idea, and the Modulo Calculator is a useful companion if you want to work through the remainders by hand.

How to Use This Calculator

The calculator has two modes and one selector.

  1. Choose a mode. Validate Code takes a complete code, including its check digit, and tells you whether that digit is the right one. Generate Check Digit takes the body only — everything before the check digit — and produces the digit that belongs at the end.
  2. Pick a standard, or leave it on auto-detect. Auto-detection works from the length of what you typed: 12 digits is a GTIN-12, 13 is a GTIN-13, 14 is a GTIN-14, 18 is an SSCC-18, and 10 is an ISBN-10. Two lengths are genuinely ambiguous and the calculator handles both: an 8-digit code is checked as a GTIN-8 and as a UPC-E, because those two standards disagree about the last digit.
  3. Read the detail. Below the verdict you get the standard that was applied, the expected check digit, the weight pattern, the weighted sum, and the full multiplication for every digit.

Example 1: validating a UPC-A

Enter 036000291452. The body is 03600029145 and the check digit is the final 2. The weights alternate 3 and 1 starting from the right, so the products are 0, 3, 18, 0, 0, 0, 6, 9, 3, 4 and 15, which add up to 58. The check digit is what brings that total to a multiple of ten, so it is 2 — the code is valid.

Example 2: validating an ISBN-10

Enter 0306406152. ISBN-10 uses a different rule: the weights run 10, 9, 8 and so on down to 1, and the total must be a multiple of eleven rather than ten. Here the products sum to 132, which is exactly 12 × 11, so the code is valid. Had the sum been one short, the last character would have to be X — the symbol ISBN-10 uses for the value ten.

Example 3: generating a check digit for a shipping label

Switch to Generate Check Digit, keep auto-detect on, and enter the 17-digit body 12345678901234567. The calculator recognises an SSCC-18, applies the GS1 weights, sums to 155 and returns 5, giving the complete code 123456789012345675.

Example 4: a UPC-E and the UPC-A behind it

Enter 01234565 in Validate Code. UPC-E compresses a UPC-A by dropping runs of zeros, so the calculator first expands the code back to its full form — 012345000065 — and then runs the ordinary GS1 check on that expansion. Both the expansion and the verdict are reported, which is the only way to see why the digit is what it is.

The Formula

Every standard here is the same two steps: multiply each digit by a weight, add the products, then choose the check digit that makes the total divisible by the modulus.

GS1 mod-10

For all GS1 identifiers the weights alternate between 3 and 1, with the weight 3 on the rightmost body digit, and the modulus is 10. [gs1-checkdigit]

check=(10−(∑i=1nwi⋅di mod 10)) mod 10\text{check} = \left(10 - \left(\sum_{i=1}^{n} w_i \cdot d_i \bmod 10\right)\right) \bmod 10
wi={3if the digit is at an odd offset from the right1otherwisew_i = \begin{cases} 3 & \text{if the digit is at an odd offset from the right} \\ 1 & \text{otherwise} \end{cases}

Because the pattern is anchored to the right, the same rule covers a 7-digit GTIN-8 body and a 17-digit SSCC-18 body without any special cases. ISBN-13 is the same calculation as GTIN-13; the only difference is that the first three digits are the 978 or 979 Bookland prefix. [isbn-manual]

ISBN-10 mod-11

ISBN-10 predates the GS1 family and uses a different modulus and descending weights. The check digit is the value that makes the whole ten-character code congruent to zero modulo 11.

∑i=110(11−i)⋅di≡0(mod11)\sum_{i=1}^{10} (11 - i) \cdot d_i \equiv 0 \pmod{11}

If the required value is ten, the code ends in the letter X. That is the only place a letter appears in any of these standards. [isbn-manual]

UPC-E expansion

UPC-E does not have its own check rule. A 6-digit body is expanded into the 11-digit body of the equivalent UPC-A according to the value of its last digit, and then the GS1 rule above is applied to the expansion. [wikipedia-upc] [gs1-eanupc]

Reference Table

GTIN-8 (EAN-8)873, 1 from the right10
GTIN-12 (UPC-A)12113, 1 from the right10
GTIN-13 (EAN-13)13123, 1 from the right10
GTIN-14 (ITF-14)14133, 1 from the right10
SSCC-1818173, 1 from the right10
UPC-E873, 1 on the expanded UPC-A10
ISBN-1010910 down to 211
ISBN-1313123, 1 from the right10
Total code length by standard: the check digit is always the last character

The length is the fastest way to identify a standard, but it is not sufficient on its own. An 8-digit code is ambiguous between GTIN-8 and UPC-E, and a 13-digit code starting with 978 or 979 is an ISBN-13 as well as a valid EAN-13 — the arithmetic is identical, so both readings are correct. [wikipedia-checkdigit]

Practical Tips

Type the digits, not the dashes. Spaces and dashes are ignored, so you can paste 0360-0029 1452 exactly as it appears on a label or a book cover. The calculator strips the separators before doing anything.

Use generate mode to build test data. If you are writing a barcode integration, generate mode gives you valid codes with the correct check digit for each standard, which is faster and safer than inventing them.

When a code fails, look at the sum. A single mistyped digit moves the weighted sum by a known amount, and a swapped pair moves it by nine times the difference between the digits. The detail line tells you the sum, so you can often spot which digit is wrong rather than re-reading the whole code.

Remember that UPC-E has two forms. The 8-digit code and the 12-digit UPC-A it expands to are different strings, and systems disagree about which one they store. The calculator prints both so you can match whatever the other system expects.

Check the length before blaming the standard. A code that is one digit short is usually a transcription error, not a new format. Auto-detect reports the length mismatch instead of silently truncating.

Do not use this for card numbers. Payment cards use Luhn, which doubles alternating digits and subtracts nine from any result above nine. Feeding a card number to a GS1 rule will produce a confident but meaningless answer. [wikipedia-checkdigit]

Limitations

  • The calculator verifies internal consistency only. A valid check digit does not prove that a GTIN is registered with GS1, that an ISBN is assigned, or that a product exists.
  • UPC-E expansion is implemented for the six-digit body form. The older zero-suppressed variants used by some legacy systems are not supported.
  • ISBN-10 codes assigned before 2007 are not automatically converted to ISBN-13 here; the two use different moduli and the conversion requires the 978 prefix plus a recomputation.
  • The SSCC-18 extension digit and the GS1 company prefix are treated as ordinary digits, because that is what the check-digit arithmetic does. Validating the prefix itself requires the GS1 registry.
  • Only the last character is ever non-numeric, and only in ISBN-10. Any other letter in the input is rejected as a typo.

Frequently Asked Questions

❓ What is a check digit?
✅ It is a final character computed from all the digits before it, chosen so that a weighted sum of the whole code lands on a multiple of the modulus. Changing any digit breaks that relationship, so a mistyped or misprinted code is detected before it is used.
❓ Why do GTIN and ISBN-13 share the same calculation?
✅ ISBN-13 was designed as a GTIN-13 with the 978 or 979 Bookland prefix, so it uses the identical 3/1 weighting and modulus 10. A 13-digit book number is therefore valid under both names.
❓ How do I calculate a GS1 check digit by hand?
✅ Write the body digits, assign weight 3 to the rightmost one and alternate 3 and 1 moving left, multiply each digit by its weight, add the products, then subtract the last digit of that total from 10. If the total ends in 0, the check digit is 0.
❓ What is the difference between UPC-A and UPC-E?
✅ UPC-A is 12 digits and UPC-E is the same product code compressed to 8 digits by removing runs of zeros. The check digit is computed on the expanded UPC-A, so the 8-digit and 12-digit forms are not interchangeable when you type them.
❓ Why does ISBN-10 sometimes end in X?
✅ ISBN-10 uses modulus 11, which leaves eleven possible remainders. Ten of them are written as digits 0 to 9 and the eleventh is written as X, following the Roman numeral for ten.
❓ Does a valid check digit mean the code is real?
✅ No. The check digit only proves the digits are internally consistent. A code can be arithmetically valid and still belong to no registered product, and a counterfeit product can carry a perfectly valid code.
❓ How many digits does an SSCC-18 have?
✅ Eighteen: an extension digit, a GS1 company prefix, a serial reference and the check digit. The check digit uses the same alternating 3 and 1 weighting as every other GS1 identifier.
❓ Can I use this calculator for credit card numbers?
✅ No. Payment cards use the Luhn algorithm, which doubles alternating digits from the right and subtracts nine from any result above nine, then checks for a multiple of ten. Use the Luhn Check Digit Calculator for those.
❓ What happens if I enter the wrong number of digits?
✅ The calculator tells you how many digits the selected standard expects and does not truncate or pad your input. In auto-detect mode it also reports when no standard matches the length you entered.
❓ Are the weights the same for every GS1 identifier?
✅ Yes. The pattern is anchored to the rightmost body digit, which always gets weight 3, and it alternates from there. That is why a 7-digit and a 17-digit body need no special handling.
❓ Why is the check digit on the right and not the left?
✅ Because the weighting is defined relative to the end of the code, so appending the check digit keeps the pattern stable no matter how long the body is. It also means the digit can be computed while the rest of the code is being printed.

The GS1 family and the ISBN family cover most of the identification numbers a developer or a warehouse operator meets, but they are not the only ones. National tax identifiers, vehicle identification numbers, bank account numbers and IBANs all append their own check characters, usually with a modulus of 10, 11 or 97 and their own weighting schemes. The arithmetic is always the same shape: weights, a sum, a remainder, and a digit chosen to make the remainder zero.

If you need to work through the remainders yourself, the Modulo Calculator exposes the modulus operation directly, and the Big Number Calculator handles the long products that appear when the body is long. The Binary Calculator and the Hex Calculator are useful when the identifier is stored in a machine format rather than as decimal text.

References

  1. [1]GS1. (2025). GS1 General Specifications, Section 7.9: Check digit calculation.
  2. [2]GS1. (n.d.). How to calculate a check digit manually.
  3. [3]GS1. (n.d.). SSCC: Serial Shipping Container Code.
  4. [4]International ISBN Agency. (n.d.). ISBN - International Standard Book Number.
  5. [5]GS1. (n.d.). EAN/UPC barcodes.
  6. [6]Wikipedia. (n.d.). Check digit.
  7. [7]Wikipedia. (n.d.). Universal Product Code.

Last updated: October 18, 2026

1b

UnByte — Independent Software Engineering

Every calculator references authoritative sources — Editorial policy