---
title: "Random Barcode Generator – Valid UPC, EAN & More for Testing"
description: "Free random barcode generator. Make valid random UPC, EAN-13, EAN-8, ISBN, ITF-14, Code 128, Code 39 and QR codes with correct check digits for testing."
url: https://barcodejar.com/random-barcode-generator
source: BarcodeJar (free barcode tools)
---

# 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.

_Interactive tool: open https://barcodejar.com/random-barcode-generator to use it in your browser. It is free with no sign-up._

## 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.

| Type | Format | With restricted prefix |
| --- | --- | --- |
| UPC-A | 11 digits + check digit | Starts with 2 |
| EAN-13 | 12 digits + check digit | Starts 20–29 |
| EAN-8 | 7 digits + check digit | Starts with 2 |
| ITF-14 | Indicator 1–8 + 12 digits + check digit | Contains a 20–29 GTIN prefix |
| ISBN-13 | 978 + 9 digits + check digit | Not applicable (ISBNs are not GS1 company numbers) |
| Code 128 / Code 39 | Random letters and digits, length you choose | Not applicable |
| QR Code | A 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](https://barcodejar.com/guides/how-to-get-a-barcode-for-your-product), then create the barcode with the [UPC generator](https://barcodejar.com/upc-barcode-generator) or [EAN-13 generator](https://barcodejar.com/ean-13-barcode-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](https://barcodejar.com/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](https://barcodejar.com/guides/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

[**Bulk Barcode Generator**Paste a list or CSV, download hundreds as ZIP or PDF.](https://barcodejar.com/bulk-barcode-generator)[**Barcode Validator**Check whether a UPC, EAN, GTIN or ISBN is valid.](https://barcodejar.com/barcode-validator)[**Check Digit Calculator**GS1 check digits for UPC, EAN, GTIN, SSCC and ISBN.](https://barcodejar.com/check-digit-calculator)[![UPC-A Generator example](/thumbs/upca.svg)**UPC-A Generator**Create UPC-A barcodes free. PNG, SVG, PDF.](https://barcodejar.com/upc-barcode-generator)[![EAN-13 Generator example](/thumbs/ean13.svg)**EAN-13 Generator**Create EAN-13 barcodes free. PNG, SVG, PDF.](https://barcodejar.com/ean-13-barcode-generator)[**Sequential Barcode Generator**Numbered barcode runs with prefix, padding and step.](https://barcodejar.com/sequential-barcode-generator)[**Online Barcode Scanner**Scan any barcode with your phone or webcam camera.](https://barcodejar.com/barcode-scanner)[**How to Get a Barcode for Your Product**GS1, resellers, Amazon and retail rules explained.](https://barcodejar.com/guides/how-to-get-a-barcode-for-your-product)
