UPC barcode generator

Paste one 11- or 12-digit number per line to get UPC-A barcodes, the 12-digit format used on products sold in the US and Canada. The generator below is set to UPC-A and opens with four sample numbers that start with 4, a range set aside for use inside one company.

Or build a numbered sequence

How a UPC-A number is built

A UPC-A barcode carries a 12-digit GTIN. The first 11 digits identify the product and the 12th is a check digit. The generator takes either form:

You typeThe generatorBarcode text
40000000001 (11 digits)Calculates the check digit and adds it400000000015
012345678905 (12 digits)Recalculates the check digit; it matches012345678905
012345678906 (12 digits)Rejects the line: wrong check digit (expected 5)Not drawn
0123456789O5 (a letter O typed for a zero)Rejects the line: UPC-A needs digits onlyNot drawn

Older guides describe a fixed layout: one number system digit, a five-digit manufacturer code, a five-digit product code and the check digit. Today GS1 US issues company prefixes of different lengths, so the line between the company part and the product part moves. The digits left after your company prefix, before the check digit, are yours to give to your products.

The check digit uses the same rule as EAN-13: weights of 3 and 1 in turn, starting with 3 on the rightmost digit of the body, then whatever brings the total up to the next multiple of 10. For the body 40000000001 that is 4×3 + 1×3 = 15, so the check digit is 5.

The number system digit

The first digit of a UPC-A is often called the number system digit. In GS1 terms it is the first digit of the company prefix, and a few values have a special meaning:

First digitUsed for
0, 1, 6, 7, 8, 9Ordinary products, numbered under company prefixes from GS1 US
2Restricted circulation within a region, mainly variable-measure items such as meat or cheese weighed in the store, where the number carries the weight or price
3Drugs and health products, with numbers based on the US National Drug Code
4Restricted circulation within one company, for items or cards a business numbers for its own use
5Reserved by GS1 US

The sample numbers in the generator start with 4 for that reason: GS1 does not issue that range to products sold in other shops. If you need UPC-A codes for items that never leave your store, ask the supplier of your till or point-of-sale system which range to use, because variable-measure numbers starting with 2 follow a layout that the till has to understand.

UPC-A and EAN-13: the same bars with a leading 0

EAN-13 was designed as an extension of UPC-A. It stores its first digit in the pattern of the left half of the barcode, and when that first digit is 0 the pattern is exactly the UPC-A one. So a UPC-A number and the same number with a 0 in front draw identical bars.

You can see this in the generator. Type 40000000001 as UPC-A and 040000000001 as EAN-13: both get the check digit 5 and both produce the same bars. Only the text underneath differs, 400000000015 against 0400000000015. The leading 0 also leaves the check digit unchanged, because a zero adds nothing to the weighted total.

What changes is how the number is reported. A scanner can send a UPC-A as 12 digits, or as 13 with a leading 0 if it is set to convert UPC-A to EAN-13. Some can also leave out the first digit or the check digit. If your database stores one form and the scanner sends another, every scan looks like an unknown product. The barcode troubleshooting checklist lists the settings to compare.

In product databases a UPC-A number is often stored as 14 digits with two leading zeros, the GTIN-14 form. 00012345678905 and 012345678905 are the same GTIN.

Selling in the US and Canada

  • Which format to print. Checkouts in the US and Canada read both UPC-A and EAN-13, and checkouts elsewhere read UPC-A too. A product with a UPC-A does not need a second barcode for Europe. Print the format your buyer's specification asks for.
  • Where the number comes from. UPC-A numbers for products sold in shops are licensed by GS1 US. Canadian companies get numbers from GS1 Canada. See how to get barcodes for products.
  • Size. At 100% of the GS1 nominal size a UPC-A is about 37.3 mm wide including its quiet zones, and the standard asks for at least 9 modules of white space on each side. Every file from the generator has 10 on each side. How to print barcode labels that scan covers bar width and scaling.
  • UPC-E. Very small packs sometimes carry UPC-E, a shortened 8-digit form that only works for numbers with zeros in the right places. This generator makes UPC-A only.

Watch for a lost leading zero

Many UPC-A numbers start with 0, and spreadsheets like to drop it. If 012345678905 becomes 12345678905, the generator sees 11 digits, treats them as a body and adds a new check digit. The result, 123456789050, is a valid UPC-A for a different number, and nothing on screen warns you. If your list came from Excel or Google Sheets, count the digits in each line first. The guide to making barcodes from Excel shows how to keep the zeros.

Frequently asked questions

Do I enter 11 or 12 digits?

Either. With 11 digits the generator adds the check digit. With 12 it verifies the check digit and rejects the line, in red, if it does not match.

What is the difference between UPC and UPC-A?

UPC is the family name. UPC-A is the full 12-digit version that most products carry, and UPC-E is a shorter form for small packs. This generator makes UPC-A.

Can I use a UPC-A barcode in the UK or Europe?

Yes. Scanners outside North America read UPC-A as well as EAN-13. New products from a European company normally get EAN-13 numbers from their local GS1 office instead.

Why do my scanned UPC codes have 13 digits?

The scanner is set to convert UPC-A to EAN-13, which adds a leading 0. Change that setting, or store the 13-digit form in your database, so that both sides match.

Can I make UPC numbers myself?

Only for use inside your own business, with a number that starts with 4. Products sold through shops or marketplaces need numbers licensed to you by GS1.

Back to the tool