Skip to main content
UPC-A is the barcode on most retail products sold in the United States and Canada. It encodes a 12-digit GTIN (Global Trade Item Number), the number that identifies a product at checkout.

Decode one

Scan or paste a barcode and see every part of it.

Make one

Generate a valid barcode from fields.

Where you’ll see it

  • Consumer products in North American retail: groceries, household goods, packaged electronics.
  • Imported products sold in the US and Canada. Many carry an EAN-13 from their home market instead, and North American checkouts read both.
  • Small packs use UPC-E, a shortened form of the same number.

Anatomy

A UPC-A symbol is 95 modules wide, where a module is the width of the narrowest bar or space. Each digit takes 7 modules, split into two bars and two spaces. The example uses a company prefix that GS1 US publishes for documentation, so it won’t identify a real product.

The first and last digits

The first digit and the check digit are printed outside the bars, often in smaller type. Their bars are drawn as tall as the guards. They’re part of the number. A UPC-A always has 12 digits, and software that keeps only the 10 in the middle can’t identify the product.

What the first digit means

The first digit is sometimes called the number system digit. It tells you what kind of number follows: After it come the rest of the company prefix and then the item reference. Company prefixes vary in length, so you can’t tell from the digits alone where one ends and the other begins.

UPC-A is an EAN-13 that starts with 0

Put a 0 in front of a UPC-A and you have a 13-digit number whose EAN-13 barcode has exactly the same bars. That’s why scanners and phone cameras often report a UPC-A as 13 digits, and why every EAN-13 scanner reads UPC-A. See The first digit has no bars.

Size and quiet zones

UPC-A is printed at the same sizes as EAN-13. At 100% size a module is 0.330 mm, making the symbol 37.29 mm wide including quiet zones, with 22.85 mm bars. GS1 allows modules from 0.264 mm (80%) to 0.660 mm (200%). The blank margins on either side are the quiet zones: at least 9 modules on each side. Artwork printed into them is a common reason for scans to fail.

Check digit

The last digit is a check digit, calculated from the other 11 with the GS1 mod-10 algorithm. Scanners recalculate it on every read and reject any read where it doesn’t match. To calculate it:
  1. Multiply the first 11 digits alternately by 3 and 1, starting with 3.
  2. Add up the results.
  3. Subtract the total from the next multiple of 10. The difference is the check digit (0 if the total is already a multiple of 10).
For the example above: Every GTIN uses the same algorithm. See Check digits.
  • UPC-E: 8 printed digits, for packs too small for a UPC-A. It expands to a 12-digit UPC-A.
  • EAN-13: 13 digits. A UPC-A is an EAN-13 with a leading 0.
  • Add-ons: a separate 2- or 5-digit barcode printed to the right, used on periodicals and books. Scanners only read it if they’re set up to.
  • ITF-14: marks the case a product ships in.
  • GS1 DataBar: carries coupons and fresh food data that UPC-A can’t.

Gotchas

  • The scan has 13 digits, not 12. Your scanner reported the UPC-A as an EAN-13. See an extra leading zero.
  • A leading zero went missing. Spreadsheets and numeric database columns drop it, turning 061414100007 into 61414100007. Store barcode values as text.
  • The scan has 11 digits. The scanner isn’t sending the check digit. See a missing last digit.
  • Numbers that start with 2 aren’t globally unique. Stores assign them, often with a weight or price embedded in the digits. Look them up with the retailer’s rules, not in a global product database.

Scanning it in your app

UPC-A is in the Retail product group, along with every other barcode that identifies a product by its GTIN, including QR Code and Data Matrix when they carry one. Most apps that scan products should enable that group, not UPC-A on its own.
Normalize what you store, so that a 12-digit and a 13-digit scan of the same product match. See Normalization.

Specification