Smart Apps Pro

Check Digits: How a Barcode Catches Its Own Typos

The last digit of a product barcode is a check digit. See how it is calculated and why it prevents most misreads.

The last digit of a product barcode has a special job. It is a check digit, and it lets a scanner verify that the other digits were read correctly.

Why it exists

Scanners can misread a digit if the code is smudged or the light is poor. A check digit gives a quick test. If the calculation does not match, the scan is rejected, and the scanner tries again.

How it is calculated for EAN-13

Take the first 12 digits.

  1. Add the digits in odd positions (1st, 3rd, 5th, and so on).
  2. Add the digits in even positions (2nd, 4th, and so on) and multiply that sum by 3.
  3. Add the two results together.
  4. The check digit is the number needed to bring the total up to the next multiple of 10.

A worked example

Take the first 12 digits 590123412345.

  • Odd positions: 5 + 0 + 2 + 4 + 2 + 4 = 17
  • Even positions: 9 + 1 + 3 + 1 + 3 + 5 = 22, and 22 × 3 = 66
  • Total: 17 + 66 = 83
  • The next multiple of 10 is 90, so the check digit is 7

The full number is 5901234123457.

What it catches

A check digit catches:

  • any single wrong digit
  • most cases where two neighbouring digits are swapped

It does not catch every possible error, but it catches most.

Other codes

Many codes use check digits, including ISBNs, credit card numbers and some shipping labels. Each has its own formula.

Tips

  • Trust a failed scan. It is protecting you from a wrong result.
  • Rescan if the digits look off.
  • Type in the digits below the bars if you must.

QR Code Scanner helps you rescan quickly, and keeps your scan history for later reference.

Scan and create QR codes and barcodes with QR Code Scanner →

QR Code Scanner app icon

QR Code Scanner

Fast QR & barcode scanner with a built-in QR code generator

Get the app

More about QR Code Scanner