UPC-A number generator — 12-digit test codes and check digits

Generate 12-digit UPC-A test numbers in the in-store or random-weight number systems, or type the first 11 digits of a UPC to get its check digit, or all 12 to check it.

Live demo · real result from this tool
Mode

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the UPC-A generator

  1. Select the Mode: Generate test values or Validate or complete.
  2. To generate, choose the Prefix: Number system 4: in-store use (safe for tests), Number system 2: random-weight items or Any number system. Set How many and press Generate.
  3. To check, type into UPC-A (or the first 11 digits to get the check digit).
  4. With 11 digits you get the Check digit and Full UPC-A. With 12 you get Result and the check digit given and expected.

What it does and when to use it

UPC-A is the 12-digit barcode used on retail products in the United States and Canada. Checkout and warehouse systems reject a UPC whose last digit is wrong, so test data must have correct check digits. This tool makes such numbers in ranges that real brands never receive.

Typical uses: loading a test product catalogue, trying out a handheld scanner app, building in-store labels for items that have no manufacturer code, or confirming the check digit on a code typed in from a pack. For the international 13-digit format, see the EAN-13 generator; for tiny packs, the EAN-8 generator. To turn the digits into bars, paste them into the barcode generator and pick UPC-A.

How it works

The check digit uses the GS1 mod-10 method on the first 11 digits:

  1. Add the digits in odd positions (1st, 3rd … 11th) and multiply that sum by 3.
  2. Add the digits in even positions (2nd, 4th … 10th).
  3. Add both totals. The check digit is what brings the result up to the next multiple of 10.

For generated numbers, the tool writes the chosen number-system digit, adds ten random digits from crypto.getRandomValues, and appends the check digit. “Any number system” uses eleven random digits.

Worked examples

  • The textbook UPC. For 03600029145: odd positions 0 + 6 + 0 + 2 + 1 + 5 = 14, × 3 = 42; even positions 3 + 0 + 0 + 9 + 4 = 16; 42 + 16 = 58, so the check digit is 2. The tool returns Full UPC-A: 036000291452.
  • Validating it. 036000291452 gives Result: Valid.
  • A misread last digit. 036000291453 gives Result: Invalid and Check digit expected: 2.
  • Test codes. Number system 4 gave 404338699347 and 424778532295; number system 2 gave 236074496085.

Limits and tips

  • Keep UPCs as text in spreadsheets. A leading 0 is part of the code.
  • The tool does not make UPC-E, the shortened 8-digit form, or encode a weight or price into number system 2 codes.
  • A valid check digit says nothing about who owns a code or what the product is.

Frequently asked questions

What is the number system digit?
The first digit of a UPC-A groups the code by use. Number system 4 is for a retailer's own in-store codes, and 2 is for random-weight items such as meat or cheese, where the shop's scale writes the item and price into the code. 0, 1, 6, 7, 8 and 9 are for normal manufacturer products, 3 for drugs and health items, and 5 for coupons.
Which option is safe for testing?
Number system 4. Those codes are never issued to manufacturers, so test numbers cannot clash with a real product. Number system 2 is also outside manufacturer ranges, but a store system may try to read a weight or price from it.
How is UPC-A related to EAN-13?
A UPC-A is an EAN-13 with a leading zero left off. 036000291452 and 0036000291452 are the same product, and the check digit is the same, because the extra zero adds nothing to the sum.
Can I sell products with these numbers?
No. Retail UPCs come from GS1 US, which licenses company prefixes. Generated numbers are test values for software, training and in-store experiments only.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close