Random UPC Code Generator
Generate a random UPC code or a whole list of them in one click with Faker, then copy the list or download it as a text file.
Input
Output
Guide
What is a UPC code?
A UPC (Universal Product Code) is the 12-digit number under the barcode on goods sold in stores, used mostly in the United States and Canada. The first eleven digits identify the company and the product, and the last one is a check digit that lets a scanner catch a misread. This full form is called UPC-A.
A random UPC code generator makes numbers in that shape for testing. Developers and testers use them in point-of-sale and inventory systems, online store product feeds, warehouse apps and barcode generators, anywhere a field expects a valid UPC. Teachers can use them to show how a check digit works.
Tool description
The page starts on UPC codes, with the first list ready as soon as it opens, one code per line. Count sets how many codes you get, Generate makes new ones, and the list can be copied or downloaded as a text file, ready for a test or a spreadsheet column.
How the codes are built
- Each code is 12 digits written together, with no spaces or hyphens.
- The check digit is always right: the digits in odd places (the first, third and so on up to the eleventh) count three times, those in even places once, and the check digit brings the total up to a multiple of 10.
- The other eleven digits are picked at random rather than assigned, so treat the codes as test data: one may match a real product by chance.
- Put a 0 in front of a code and you get a valid EAN-13 code with the same check digit.
Good to know
- The first digit can be anything from 0 to 9. Real codes keep some first digits for special uses, such as 2 for goods weighed and priced in the store and 5 for coupons, so filter the list if your system reads that digit.
- About one code in ten starts with 0, which a spreadsheet drops unless the column is formatted as text.
- To check that a form rejects mistakes, change one digit: the check digit stops matching.
Features
- 12-digit UPC-A codes with a valid check digit
- Plain digits, ready for barcode tools and test data
- A fresh list with one click
- Copy the list or download it as a text file
- Runs in your browser: nothing you generate is sent anywhere