Skip to content
UPC Maker

How to Read a Barcode: What the Numbers and Bars Mean

By UPC Maker · Last reviewed November 13, 2026

The digits printed under a barcode are the entire message. On a 12-digit UPC, the first digits belong to the brand, the next ones pick out the product, and the last is a check digit worked out from the other eleven. The bars say exactly the same thing in a form a scanner can read. No price, product name or country of origin is stored in them.

The three parts of a UPC number

Take the UPC 012345678905, a number often used in examples. It splits into three parts.

PartLengthWho decides it
Company prefix6 to 10 digitsGS1, which licenses it to one brand
Item reference1 to 5 digitsThe brand, one per variant
Check digit1 digitArithmetic

Many guides say the first six digits are the manufacturer and the next five are the product. That was true decades ago. Today prefixes vary in length, so you cannot see where the prefix ends just by looking. In our example the prefix could be 012345 with item 67890, or 01234567 with item 890. Only GS1's records say which.

What the first digit tells you

The first digit of a UPC is called the number system digit. It is part of the prefix, and it hints at what kind of item you are holding.

  • 0, 1, 6, 7, 8 or 9: an ordinary product.
  • 2: an item weighed or priced in the store, such as meat, cheese or produce.
  • 3: medicines and health items.
  • 4: a number the retailer made for its own use, such as a loyalty card.
  • 5: a coupon.

A barcode starting with 2 is the one exception to the rule that barcodes carry no price. The shop's scale prints it, and some of its digits hold the weight or the price of that one pack. The layout is chosen by the retailer, so it only makes sense inside that shop.

The last digit: check it by hand

The twelfth digit exists to catch mistakes. You can test any UPC with a pencil.

  1. Write the first 11 digits: 0 1 2 3 4 5 6 7 8 9 0.
  2. Add the digits in the odd positions (1st, 3rd, 5th and so on): 0 + 2 + 4 + 6 + 8 + 0 = 20.
  3. Multiply by 3: 20 x 3 = 60.
  4. Add the digits in the even positions: 1 + 3 + 5 + 7 + 9 = 25.
  5. Add the two results: 60 + 25 = 85.
  6. Find what takes you to the next multiple of 10: 90 minus 85 is 5.

The check digit is 5, which matches the printed number. If your result differs from the last digit on the pack, a digit was misread or mistyped. If the sum already ends in 0, the check digit is 0, not 10. The check digit calculator does the same sum and shows each line.

A correct check digit proves only that the digits agree with each other. It does not prove the number is licensed to anyone. One made-up number in ten passes by luck.

What a barcode does not tell you

  • The price. The till looks the number up in the shop's own database. That is why the same product can cost different amounts in two shops.
  • The product name. Also looked up. The bars hold digits and nothing else.
  • Where it was made. On a 13-digit EAN, the first two or three digits show which GS1 office licensed the number. A brand registered in one country can manufacture anywhere.
  • The expiry date or batch. A retail UPC cannot hold them. Those travel in other barcodes, such as GS1-128 on cases or a Data Matrix on small packs.

How to read the bars themselves

You can decode a UPC by eye with a ruler and some patience. A UPC-A barcode is 95 units wide, where one unit is the width of the thinnest bar. Bars and spaces are each 1, 2, 3 or 4 units wide.

The guard bars

Three pairs of thin bars usually hang lower than the rest. They carry no digits.

  • Left guard: bar, space, bar. Three units.
  • Centre guard: space, bar, space, bar, space. Five units.
  • Right guard: bar, space, bar. Three units.

Six digits sit between the left and centre guards, and six between the centre and right. That gives 3 + 42 + 5 + 42 + 3 = 95 units.

The digits

Every digit takes exactly 7 units, drawn as two bars and two spaces. On the left half, each digit runs space, bar, space, bar. The table gives the four widths in that order.

DigitWidths (space, bar, space, bar)
03, 2, 1, 1
12, 2, 2, 1
22, 1, 2, 2
31, 4, 1, 1
41, 1, 3, 2
51, 2, 3, 1
61, 1, 1, 4
71, 3, 1, 2
81, 2, 1, 3
93, 1, 1, 2

On the right half the same widths are used, but the colours swap: each digit runs bar, space, bar, space. So a 0 on the left is a wide space, a 2-unit bar, a thin space and a thin bar. A 0 on the right is a wide bar, a 2-unit space, a thin bar and a thin space.

That swap is how a scanner knows which way up the pack is. Left-side digits always contain an odd number of dark units, and right-side digits an even number. If the scanner meets the even ones first, it is reading backwards and flips the result.

Reading other barcodes

A 13-digit EAN reads the same way, with one twist: its first digit has no bars of its own. It is signalled by the pattern used for the six digits in the left half, as explained on the EAN-13 generator page. A UPC is an EAN whose hidden first digit is 0.

Barcodes with letters under them, such as stockroom labels and shipping labels, are usually Code 128 or Code 39 and follow different rules. The names are untangled in UPC vs EAN vs GTIN vs SKU.

The quick way

To read a barcode without a ruler, photograph it and open the online barcode scanner. It returns the digits and the barcode type. To see the bars for any number, type it into the UPC generator and compare the image with the table above.

If you are reading barcodes because you are about to put one on your own product, the next question is where the number comes from. That is covered in do you need a GS1 UPC.

Frequently asked questions

Can you tell what country a product is from by its barcode?

No. The first digits of an EAN show which national GS1 office licensed the number to the brand. They say nothing about where the product was made. A company registered in one country can produce its goods anywhere.

Is the price stored in the barcode?

Not on a normal product. The till reads the number and looks up the price in the shop's own system. The exception is a label printed in store for weighed items, which starts with 2 and can carry the price or weight of that pack.

What does the small digit on the far right mean?

It is the check digit. It is calculated from the other eleven digits, and a scanner recalculates it on every read. If the two do not match, the scan is rejected.

Can I find out who owns a barcode number?

GS1 runs a public lookup that shows the company a number is licensed to, when the brand has shared that information. A phone scanner app may also show a product name, but that comes from the app's own database and can be wrong or missing.

Why do some bars stick out below the others?

Those are the guard bars at the left, centre and right. They mark the start, middle and end of the barcode for the scanner and do not stand for any digit.

Keep reading