Scanbot SDK has been acquired by Apryse! Learn more

Learn more
Skip to content

What is a check digit, and why does it matter?

Maya November 19, 2025 9 mins read
Blog Cover What is a check digit

Definition and purpose 

A check digit is a short value – typically one character – calculated from the rest of an identifier using a specific algorithm. Its job is simple, but critical: to detect errors that occur during printing, scanning, or manual entry. 

What is a check digit, and why does it matter?

When you scan a barcode or enter a number, the system recalculates the check digit based on the other characters. If the calculated value doesn’t match the actual check digit, the input is rejected. This real-time validation catches mistakes before they can cause problems downstream. 

In practice, you’ll find check digits everywhere. Beyond barcodes, they also show up in payment card numbers, in the machine-readable zones (MRZs) on passports and ID cards, and in Vehicle Identification Numbers (VINs).  

What is a check digit, and why does it matter?

Why check digits matter 

The primary purpose of a check digit is error detection. This ensures data integrity, which is crucial for automated workflows. Check digit validation is not just a nice-to-have.  

In fact, most business identifiers include mandatory check digits, as specified by standards or regulators. GS1 barcodes – including the Global Trade Item Number (GTIN), Global Location Number (GLN), and Serial Shipping Container Code (SSCC) – all feature check digits.  

For passports, the International Civil Aviation Organization (ICAO) uses multiple check digits to help readers verify that data in the MRZ is correctly interpreted. Similarly, the US Federal Motor Vehicle Safety Standards (FMVSS) require a check digit in position nine of a VIN. 

Check digits in machine-readable zones (MRZs) 

In the MRZ of passports, ID cards, and visas, several fields end with a check digit.  

When a scanner reads the MRZ, it recomputes each check digit and compares it with the printed one. Any mismatch flags the read as unreliable, preventing bad data from entering border-control systems or downstream databases. 

What is a check digit, and why does it matter?

The ICAO specifies the MRZ layout and check digit method in Doc 9303. States and issuing authorities implement these rules for personal travel documents, ensuring that documents and readers are interoperable worldwide.  

There are several MRZ formats. While all use the same ICAO Doc 9303 algorithm, the number of check digits and their exact positions depend on the document type.  

Document typeFields with check digitsWhere check digits appear
Passport (TD3)Document number
Date of birth
Date of expiry
Personal/optional number
Composite
All five check digits are on Line 2 of the MRZ in positions 10, 20, 28, 43, and 44. 
ID card (TD1)Document number 
Date of birth 
Date of expiry 
Composite  
Per-field check digits sit next to their fields on Line 1 or 2. The composite is on Line 3 (end position). 
Visas (MRV-A/MRV-B)Document/visa number 
Date of birth 
Date of expiry 
Per-field check digits sit next to their fields (no composite check digit). 

While check digits in MRZs catch mistakes and make global reading consistent, they are not a security feature. They neither encrypt data nor prevent forgery – they are strictly for error detection. 

Which barcodes need a check digit? 

The majority of 1D barcodes require a check digit. Modern 2D barcodes like QR Code and Data Matrix instead use more advanced error correction techniques.  

The table below shows the barcode type, if they require a check digit, and which algorithm is used to calculate the check digit. 

Barcode typeCheck digitAlgorithm
EAN-13 / UPC-A 
(GTIN-13 / GTIN-12) 
RequiredMod-10
UPC-ERequiredMod-10 after expansion to UPC-A
Interleaved 2-of-5 (ITF) OptionalMod-10 when enabled 
ITF-14  
(GTIN-14) 
RequiredMod-10
Code 128 RequiredWeighted Mod-103 
GS1-128 RequiredMandatory Mod-103 check character at the symbol level. Contained 
GS1 Identifiers, like GTIN or SSCC, include their own Mod-10 digit. 
Code 39 OptionalMod-43 when enabled 
Code 93RequiredMod-47 (for both check characters) 
Codabar OptionalMod-16 when enabled 
MSI Plessey OptionalImplementations vary: Mod-10, Mod-11, Mod-10-10, Mod-11-10

Checksum algorithms: How to calculate a check digit  

In the following, we go through some commonly used algorithms and briefly describe how they are calculated. 

Mod 10 – Luhn algorithm 

The basic Luhn algorithm is used to calculate check digits in credit cards, IMEI numbers, and some national ID numbers. 

“Mod 10” refers to the modulo, or remainder, of dividing a value by 10. It is a prominent part of the algorithm. 

How it works: 

  • Read digits from right to left. 
  • Double every second digit. If the result is greater than 9, subtract 9. 
  • Sum all digits. 
  • The check digit is the smallest value that makes the total a multiple of 10.  
  • The basic formula for this value is (10s) mod 10, where s is the sum from before. 

Mod 10 – EAN/UPC Weighted (1, 3) 

This Mod 10 variant is used for GS1 identifiers such as GTIN-12/UPC-A, GTIN-13/EAN-13, GTIN-8/EAN-8, GTIN-14/ITF-14, GLN, SSCC, GSIN, GSRN. As such, they can appear in carriers such as GS1-128 and GS1 DataBar barcodes (though the carriers have their own check characters as well). 

How it works:  

  • Read digits from right to left. 
  • Multiply digits alternately by 3 and 1. 
  • Sum the products. 
  • The check digit is the smallest value that makes the total a multiple of 10. 

Mod 10 – ICAO 9303 Weighted (weights 7, 3, 1) 

This Mod 10 variant is used in MRZ fields for passports (TD3), ID cards (TD1), and visas (MRV-A/MRV-B). 

How it works: 

  • Convert characters to values: digits = 0–9, letters = 10–35, “<” = 0. 
  • Apply repeating weights 7, 3, 1 from left to right. 
  • Sum the products. 
  • The check digit is the sum mod 10. 

Mod 11 – VIN (FMVSS) 

The Mod 11 algorithm defined in the US FMVSS section 565 is used for Vehicle Identification Numbers (VINs). 

How it works: 

  • Convert letters A–Z to numeric values per section 565.15. Digits retain their value. 
  • Multiply by fixed position weights: 8, 7, 6, 5, 4, 3, 2, 10, 0 (this is the check digit), 9, 8, 7, 6, 5, 4, 3, 2. 
  • Sum the products. 
  • Divide this sum by 11 and take the remainder (sum mod 11). 
  • This will be a decimal number. Round to the nearest thousandth. 
  • The final digit is the check digit. If it is 0, represent it with “X”. 

In VINs created to other standards, especially ISO 3779, a valid check digit is not mandatory, but manufacturers do sometimes implement it. 

Mod 97-10 (ISO 7064) 

Mod 97-10, as defined in ISO 7064, is used for International Bank Account Numbers (IBAN). 

How IBAN validation works: 

  • Move the first four characters to the end. 
  • Convert A–Z to 10–35. Digits remain unchanged. 
  • Interpret the result as a single large integer and compute mod 97. 
  • A valid IBAN yields a result of 1. 

Mod 103 – Positional Weighted (Code 128) 

Mod 103 is used for the symbol-level check character in Code 128 (including GS1-128). 

How it works: 

  • Look up the value (0 to 105) corresponding to each symbol. 
  • Multiply each value by its position index. The start symbol and the first encoded symbol are both in position 1. 
  • Sum the weighted values. 
  • The check character corresponds to the value of sum mod 103. 

Note: GS1 application data within the barcode (e.g., GTIN, SSCC) may use its own GS1 check-digit rules, typically the EAN/UPC Mod 10 algorithm. The symbology itself uses Mod 103 for the entirety of the data. 

Mod 43 – Simple Sum (Code 39) 

Mod 43 is often enabled as an optional guardrail in Code 39. It is used for HIBC barcodes, for example. 

How it works: 

  • Look up the value (0–42) corresponding to each symbol. 
  • Sum the values. 
  • The check character corresponds to the result of sum mod 43. 

Which check character algorithm to use 

In practice, choosing a checksum scheme is usually straightforward: Follow the algorithm mandated by the relevant standard (GS1 rules, barcode symbology specs, or your industry standards) and use it consistently.  

The crucial part is alignment – making sure both your code generator and your scanners are configured to use and validate the same checksum rules.

Conclusion 

Check digits are a small detail with an outsize impact. They provide a simple, standardized way to detect errors early, before incorrect data enters core systems and workflows. 

Used correctly and in line with the relevant standards, check digit validation helps keep your data clean, processes stable, and downstream operations running smoothly. 

FAQ

Why does my scanner reject barcodes without a check digit?

Many scanners are configured to validate check digits by default. After decoding the barcode, they recalculate the expected check digit and, if it is missing or invalid, they suppress the output instead of sending the data on. 

You can usually change the scanner configuration to ignore check digits. Generally, it is better practice to generate barcodes with a valid check digit wherever the symbology or standard allows or requires one. 

Can I turn off the check digit validation in the Scanbot Barcode Scanner SDK?

Yes. You can disable check digit validation in the Scanbot Barcode Scanner SDK. By default, the scanner only returns results for barcodes with a valid check digit. We generally don’t recommend turning validation off, as check digits are an important safeguard for catching errors at the point of capture. 

Why does the Scanbot Barcode Scanner SDK return a wrong result or no result at all?

You might encounter barcodes that don’t contain a check digit in symbologies where the SDK expects one. The demo app validates check digits by default for all supported symbologies.

For example, when scanning a Code 11 symbol without a check digit, the SDK will still try to validate it and may either: 

Reject the code and return no result, or 
– In rare cases, “repair” the read by swapping similar-looking characters (e.g., 0 ↔ 1), accidentally producing an incorrect but valid-looking result. 

To avoid this, you can disable check-digit validation for that symbology. Where possible, we recommend using barcodes that do include a proper check digit. 

What is the difference between a checksum and a check digit?

Every check digit is a checksum, but not every checksum is a check digit.  

A checksum is any value calculated from underlying data to help detect errors – it can be multiple characters long, binary, or even a hash.  

A check digit is a specific type of checksum: typically, a single character at the end of an identifier, such as a barcode or account number. Check digits are used to validate that identifier at the point of entry or scanning. 

What is a composite check digit?

A composite check digit is a check digit calculated over multiple fields combined into one sequence, rather than over a single field. It provides an additional layer of error detection by verifying the integrity of the entire group of fields. Composite check digits are used in the machine-readable zones of passports and ID cards. 

Related blog posts

Experience our demo apps

Barcode Icon Art

Barcode Scanner SDK

Scan 1D and 2D barcodes reliably in under 0.04s. Try features like Batch Scanning, Scan & Count, and our AR Overlays.

Launch Web Demo

Scan the code to launch the web demo on your phone.

Web QR Code

Also available to download from:

Document Icon Art

Document Scanner SDK

Scan documents quickly and accurately with our free demo app. Create crisp digital scans in seconds.

Launch Web Demo

Scan the code to launch the web demo on your phone.

Black and white QR code. Scan this code for quick access to information.

Also available to download from:

Data_capture Icon Art

Data Capture Modules

Try fast, accurate data capture with our demo app. Extract data from any document instantly – 100% secure.

Launch Web Demo

Scan the code to launch the web demo on your phone.

Black and white QR code. Scan this quick response code with your smartphone.

Also available to download from: