How to use the UPC-A generator
- Select the Mode: Generate test values or Validate or complete.
- 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.
- To check, type into UPC-A (or the first 11 digits to get the check digit).
- 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:
- Add the digits in odd positions (1st, 3rd … 11th) and multiply that sum by 3.
- Add the digits in even positions (2nd, 4th … 10th).
- 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 returnsFull UPC-A: 036000291452. - Validating it.
036000291452givesResult: Valid. - A misread last digit.
036000291453givesResult: InvalidandCheck digit expected: 2. - Test codes. Number system 4 gave
404338699347and424778532295; number system 2 gave236074496085.
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?
Which option is safe for testing?
How is UPC-A related to EAN-13?
Can I sell products with these numbers?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.