How to read a barcode number, by hand and with a scanner

What each part of an EAN-13 and UPC-A number means, how the bars encode digits, and how to work out the check digit yourself.

To read a barcode, read the numbers printed under the bars. On an EAN-13, the first 2 or 3 digits are the GS1 prefix, the middle digits identify the company and product, and the last digit is a check digit. A scanner simply turns the widths of the bars back into those same digits.

Parts of an EAN-13

Take 5901234123457:

Part Digits Meaning
GS1 prefix 590 Issued by GS1 Poland
Company prefix and item reference 123412345 Set by GS1 and the brand owner; the split varies by company
Check digit 7 Calculated from the first 12 digits

Parts of a UPC-A

Take 012345678905:

Part Digits Meaning
Number system 0 Regular product
Manufacturer and product 1234567890 Assigned through GS1 US
Check digit 5 Calculated from the first 11 digits

How the bars encode digits

Each digit in an EAN-13 or UPC-A takes up 7 thin units called modules, drawn as two bars and two spaces of different widths. Extra-long bars at the left, middle, and right are guard bars that tell the scanner where the code starts, splits, and ends.

In an EAN-13 the very first digit has no bars of its own. It is encoded by the pattern of the next six digits, which is why only 12 digit groups appear between the guards.

You do not need to decode bars by hand; the printed digits always match them.

Work out the check digit yourself

  1. Write the first 12 digits of an EAN-13 (or 11 of a UPC-A).
  2. Starting from the right, multiply the digits by 3, 1, 3, 1, and so on.
  3. Add the results.
  4. The check digit is the number you add to reach the next multiple of 10.

For 590123412345: the weighted sum is 83, the next multiple of 10 is 90, so the check digit is 7. The check digit calculator does this instantly.

Reading a barcode with your phone

  1. Open the online barcode scanner and choose Barcode mode.
  2. Press Start Scan and hold the phone 10 to 20 cm from the code.
  3. The digits and the code type appear. Press Search Product to look the number up.

For a barcode in a photo or screenshot, use scan from image. To understand the first digits, see barcode country codes.

Scan history