Random Barcode Generator (Random Barcode Numbers)
Pick a barcode type and how many, and get random numbers with valid check digits drawn as a printable test sheet.

How to use the Random Barcode Generator
- Choose the Barcode type (symbology): EAN-13, UPC-A, ITF-14 (GTIN-14 cartons), Code 128 or Code 39.
- For EAN-13, UPC-A and ITF-14, choose a Number range (prefix). Pick 952 for GS1 demo numbers, 04x for internal use, 2xx for in-store numbers, Any digits, or My own leading digits. If you pick My own leading digits, type your digits into Leading digits.
- For Code 128 and Code 39, set Characters per barcode (length).
- For Code 128 and Code 39, choose Characters (charset): Digits 0–9, Digits and capital letters, or Digits, capital and small letters (Code 128 only).
- Enter How many barcodes (1 to 100).
- Leave the Seed as it is to keep the same set, or click New random set for a new one.
- Set Labels per row (2 to 5). Under More options you can change the Bar width (X), Bar height, Print the digits under the bars, Quiet zones, Bar color, Background and PNG resolution (300 or 600 dpi).
- Click Copy all numbers for the list, or download the sheet as SVG or PNG.
- Check the result lines: Barcodes generated, First value, Fixed leading digits, Label size and Bar width.
The example buttons (EAN-13 GS1 demo range, UPC-A internal range, Code 128 with 10 characters, and ITF-14 cartons) fill in the settings for you. Use Copy link to share the page; it keeps all your inputs, so opening it restores the same result. Print / save as PDF includes your inputs, the result, the calculation steps and the date.
How does a random barcode generator make numbers that scan?
A barcode scanner reads the bars and checks the number against a rule. For EAN-13, UPC-A and ITF-14, the last digit is a check digit calculated from the others. The tool first makes random digits, then calculates the correct check digit. Every number therefore passes the check and scans as valid.
The check digit for EAN-13 works like this. Starting from the left, multiply the first 12 digits alternately by 1 and 3, add the results, and subtract the total’s last digit from 10. If the result is 10, the check digit is 0. The first demo number from the EAN-13 preset, 9523030668947, shows this: the weighted sum of its first 12 digits is 113, and 10 − 3 = 7, which is the final digit.
Which random barcode numbers are safe to use for testing?
Number ranges matter more than the digits themselves. GS1 sets aside some prefixes that never identify a real retail product. Prefix 952 is used for demonstrations and examples. Prefixes 040–049 are for use inside one company. Prefixes 200–299 are restricted for in-store or local use, as set by the local GS1 office.
A 12-digit UPC-A has an implied leading zero. So a UPC-A starting with 4 falls in the 04x range, and one starting with 2 falls in the 02x range. Random numbers outside these reserved ranges can match the barcodes of real products. For that reason, the 952 and 04x ranges are the safest choices for tests.
A GS1 prefix does not show where a product was made, because GS1 member companies can make products anywhere. Random barcodes are for testing only. Products sold in shops need GTINs licensed from GS1.
Code 128 and Code 39 work differently. The tool makes random strings of the length you choose, from digits, capital letters and, for Code 128 only, small letters. Code 39 has no small letters.
The seed controls repeatability. The same seed and settings always give the same numbers. The page link saves the seed, so the sheet can be reproduced later.
Sources
- GS1 Company Prefix list (read 12 October 2026) — 952 for demonstrations and examples; 02x, 04x, 2xx restricted circulation; 977–979 ISSN/ISBN; implied leading zero of 12-digit GTINs.
- GS1 General Specifications 7.9 — the GS1 check digit (weights 3 and 1 from the right). Samples were decoded with zxing-cpp.
Worked examples
| Input | Result |
|---|---|
| 12 × EAN-13, seed 20261012 | 9523030668947 … 9529163541591 |
| 5 × UPC-A, seed 20261012 | 430306689447 … 457461292046 |
| 5 × Code 128, seed 20261012 | C0D0ONTW … CCRR200T |
| 3 × ITF-14 (GTIN-14 cartons), seed 20261012 | 39520306689447 … 79521510127891 |
Calculated by the tool above with these values.
Frequently asked questions
Can I use these random barcodes on real products?
No. Random numbers are for tests and demos; numbers outside the reserved ranges can even match other companies’ products. Products sold in shops need GTINs licensed from GS1.
Are the generated barcode images free to use?
Yes. You can use the images in test labels, training material, software demos and mock-ups, including commercial work, with no attribution required.
Why do the EAN-13, UPC-A and ITF-14 numbers scan as valid?
The tool makes random digits and then adds the correct GS1 check digit. The scanner’s check passes, so the number reads correctly.
What does the seed do?
The seed sets the random numbers. The same seed and settings always produce the same set. Click New random set to get a new seed and a new set.
Does the tool upload what I type?
No. Everything runs in your browser, and nothing you type is uploaded.
Which barcode type should I choose for testing?
Choose the type your scanner, label printer or software expects. EAN-13 and UPC-A suit retail-style tests, ITF-14 suits carton labels, and Code 128 or Code 39 suit general label and warehouse tests.
Can I print the random barcodes as a sheet?
Yes. Choose the labels per row, then download the sheet as SVG or PNG, or use Print / save as PDF.
Related tools
- Barcode generator — Code 128, Code 39, EAN, UPC, ITF-14, Codabar and GS1-128, single or a sheet of labels.
- GTIN generator — GTIN-13, UPC-A and GTIN-14 lists from your company prefix.
- UPC check digit calculator — get or verify the check digit of a UPC, EAN, GTIN-14, GLN or SSCC.
- Code 128 barcode generator — Code 128 with the code sets and check character worked out.
- UPC barcode generator — UPC-A and UPC-E barcodes for retail products, with add-ons and GS1 sizes.
- GS1 barcode generator — GS1-128 labels with Application Identifiers, EAN-13 and ITF-14 carton codes.