Skip to the content
UPC Generator

What is a UPC code?

A UPC code, short for Universal Product Code, is a 12 digit number that names one specific product. It is printed as bars so a scanner can read it. It holds no price and no product name, only a key that a store's system looks up.

By the UPC Generator team. Written from the GS1 General Specifications, Release 26.0, GS1 US pages and the published digit tables, which the UPC generator's bars are matched against. Last updated 4 November 2026. How UPC Generator pages are made.

A UPC-A barcode with brackets under the digits marking the company prefix, the item reference and the check digit
An example number on the company prefix GS1 uses in its own documents, split into its three parts.

What the 12 digits mean

A UPC has three parts, and only the last has a fixed length.

The three parts of a UPC
Part Length Who sets it
U.P.C. Company Prefix 6 to 10 digits GS1 US, when your company licenses numbers
Item reference Whatever is left Your company, one for each product
Check digit 1 digit, the last Worked out from the other 11

The company prefix gets shorter as a license covers more products, because a business with more items needs more digits left over to number them. A license for 10 items leaves one digit, and a license for 100,000 leaves five.

Take 614141234561, an example built on the company prefix GS1 uses in its own documents. The opening digits belong to one company, the digits after them are that company's own item number, and the final 1 is the check digit. A scanner reads an unseen zero in front, so GS1 lists the full company prefix as 0614141. Its first three digits, 061, fall in the GS1 US range.

How the bars carry the digits

A UPC-A is 95 modules wide, where a module is the width of the thinnest bar. Each digit takes 7 modules and is always drawn as two bars and two spaces. Three guard patterns, at the start, middle and end, tell the scanner where the digits begin and how wide a module is.

The right six digits use the left six's patterns with black and white swapped. Every left pattern has an odd number of dark modules and every right pattern an even number. That lets a scanner tell which way it is reading from the patterns alone. That is why you can swipe a product in either direction. You can see this with your own number in the UPC generator, where each digit lights up its own bars.

What the check digit does

The last digit is a sum over the others, and a scanner repeats that sum on every read. If the answer does not match, the scanner rejects the read rather than ring up the wrong product. This catches every single wrong digit and most swapped pairs. The calculator for check digits shows the steps for any number.

A correct check digit does not make a number real. Anyone can calculate one for 11 random digits.

UPC, EAN and GTIN

These three get mixed up constantly, and they are not the same kind of thing.

UPC, EAN and GTIN side by side
Term What it is Digits
GTIN The number itself, in GS1's terms 8, 12, 13 or 14
UPC The barcode that carries a GTIN-12 in North America 12
EAN The barcode that carries a GTIN-13 elsewhere 13

A UPC-A is the same set of bars as an EAN-13 with a leading zero, so retail scanners worldwide read both. The EAN-13 generator shows how that works. A SKU is a different thing altogether: your own stock code, which no one outside your business needs to understand. What a SKU is sets it beside the UPC, the ASIN and the serial number.

One number for each variation

GS1 US puts it simply: each variation of a product needs its own barcode. A shirt in 3 sizes and 3 colors needs 9 numbers, because a store needs to count them separately. The same goes for a new size or a new pack count.

A short history

The first item with a UPC scanned at a checkout was a pack of Wrigley's gum. It was scanned at the Marsh supermarket in Troy, Ohio, on 26 June 1974. Wikipedia gives the time as 8:01 a.m., the item as a 10-pack of Juicy Fruit and the price as 67 cents.

Getting one for your product

A number for goods in stores should come from GS1, not from a generator. The number must belong to your company, and retailers can look up who holds it. A made-up number on goods for sale misleads the store and the buyer. The guide to getting a UPC code covers the route and what it costs. If you need a barcode only for your own stock, tests or a mock-up, you can make a UPC barcode here. Use a number from the internal-use range.

The last digit is explained in what a check digit is. The scanner's side of the story is in how barcodes work, and the number's family is in what a GTIN is. The number on a product you already have is found with where the UPC code is on a product. How all this started is in who invented the barcode.

More about UPC codes

What does UPC stand for?

Universal Product Code. The number inside it is what GS1 now calls a GTIN-12.

Does a UPC code show the price?

No. The barcode only holds the number. The store's own system looks that number up and returns the price, which is why two stores can charge differently for one code.

How many digits are in a UPC code?

Twelve on a UPC-A, the usual kind. A UPC-E on a small pack shows 8, because it leaves out zeros that a scanner restores.

Do the digits say where a product was made?

No. The opening digits show which GS1 office licensed the number, and GS1 is clear they say nothing about country of origin.

Is a UPC the same as a barcode?

A UPC is one kind of barcode. Barcode is the general word, and it also covers Code 128, QR codes and many others that have nothing to do with store products.

5 source documents

  1. GS1: General Specifications, Release 26.0, sections 1.2, 5.2 and 7.9, fetched 2 November 2026
  2. GS1: GS1 Company Prefix list, fetched 2 November 2026
  3. GS1 US: Guide to UPCs, fetched 2 November 2026
  4. GS1 US: How to get a UPC barcode, fetched 2 November 2026
  5. Wikipedia: Universal Product Code, history, fetched 2 November 2026