Random Barcode Generator

Generate random barcodes that are valid: UPC-A, EAN-13, EAN-8, ISBN-13 and ITF-14 numbers with correct check digits, plus Code 128, Code 39 and QR test codes. Copy the list or download the images. For testing only, not for retail products.

  • 100% free
  • No sign-up
  • No watermark
  • Works offline in your browser

12 digits with a valid check digit.

For testing and mock-ups only. Random UPC/EAN numbers are not registered with GS1 and must not be used on products you sell.
286177375848
254135700070
255880140807
216494938822
277666654506
240444196154
Open in bulk tool →

How to generate random barcodes

  1. Choose the barcode type, such as UPC-A, EAN-13 or Code 128.
  2. Set how many codes you need (up to 1,000). Keep the restricted-circulation prefix on for UPC/EAN test data.
  3. Click Generate. Every number has a valid check digit.
  4. Copy the list, download a CSV, or download the barcodes as PNG or SVG files in a ZIP.

Valid random codes for testing

A random string of 12 digits is almost never a valid UPC, because the last digit must match the GS1 check digit calculation. This generator builds each number from random digits and then calculates the correct check digit, so the codes pass the same validation that scanners, point-of-sale systems and e-commerce platforms apply.

TypeFormatWith restricted prefix
UPC-A11 digits + check digitStarts with 2
EAN-1312 digits + check digitStarts 20–29
EAN-87 digits + check digitStarts with 2
ITF-14Indicator 1–8 + 12 digits + check digitContains a 20–29 GTIN prefix
ISBN-13978 + 9 digits + check digitNot applicable (ISBNs are not GS1 company numbers)
Code 128 / Code 39Random letters and digits, length you chooseNot applicable
QR CodeA random token starting with TEST-Not applicable

Testing only: why you can't sell with a random UPC

UPC and EAN numbers identify a specific product from a specific company. They start with a GS1 Company Prefix licensed to that company, which is how retailers know the code is unique. A random number may already belong to another company's product, and even if it doesn't today, it could be assigned later. Marketplaces such as Amazon check GTINs against GS1 data and can remove listings that use numbers not licensed to the brand.

To sell in stores or online you need your own numbers from GS1. Read how to get a barcode for your product, then create the barcode with the UPC generator or EAN-13 generator.

Good uses for random barcodes

  • Seeding a test database or staging store with products that have realistic, valid GTINs.
  • Checking that a scanner is set up for a symbology and adds or strips check digits as expected.
  • Unit tests for check digit and validation code. Verify results with the barcode validator.
  • Props, packaging mock-ups and training sheets that should not ring up a real product.

Frequently asked questions

Are these random barcodes valid?

Yes, structurally. Every UPC, EAN, ISBN and ITF-14 number has the correct GS1 check digit and the right length, so scanners and validation code accept it. They are not registered to any product.

Can I use a random barcode on a product I sell?

No. Retail barcodes must come from GS1 so the number is unique to your company. A random UPC or EAN may belong to someone else's product, and retailers and marketplaces can reject it. See how to get a barcode for your product.

What does "restricted circulation prefix" mean?

GS1 reserves some prefixes for internal use: UPC numbers starting with 2 and EAN-13 numbers starting 20–29 (EAN-8 numbers starting 2). Codes in those ranges are never assigned to retail products, so test data built on them cannot clash with a real item. Note that some shops use these ranges for weighed or in-store items.

What are random barcodes useful for?

Testing point-of-sale and inventory software, filling demo databases, checking that a scanner is configured for a symbology, training staff, and creating mock-up packaging or props that should not scan as a real product.

How many random barcodes can I generate?

Up to 1,000 at a time. Copy the list, download it as a CSV or text file, or download every barcode as PNG or SVG files in a ZIP.

Are the numbers truly random?

They use your browser's cryptographic random number generator (crypto.getRandomValues), and duplicates are removed from each batch.

Related free tools