Random Barcode Number Generator
Generate scannable EAN-13, UPC-A, EAN-8 and Code 128 barcode images — random test codes or your own value, with check digits done for you
See 1 example
- Example 1
EAN-13 barcode: 2606016688164
About this generator
This tool generates real, scannable barcode images in four formats: EAN-13, UPC-A, EAN-8 and Code 128. Leave the value box empty and you get 1 to 20 random test barcodes with valid check digits. Random EAN-13 codes start with 2 (the 200–299 range GS1 reserves for in-store, restricted circulation), random UPC-A codes start with 4 (in-store use), random EAN-8 codes start with 2, and random Code 128 codes look like TEST-12345678 or SKU-ABC-1234 — none of them belong to a registered product. Type your own value to draw exactly that barcode instead. For EAN-13, UPC-A and EAN-8 you can enter the digits without the check digit (12, 11 or 7 digits) and it is calculated for you, or the full number, in which case the check digit is verified and a clear message explains any mistake. Code 128 takes up to 48 printable ASCII characters — letters, digits, spaces and punctuation — and switches between code sets B and C automatically to keep the barcode as short as possible. Bar size sets the narrowest bar to 2, 3 or 4 pixels. Each barcode has guard bars, quiet zones and human-readable text in the standard layout, and you can Download PNG or SVG, or Print.
How to use
- Choose a Format: EAN-13, UPC-A or EAN-8 for retail-style numbers, or Code 128 for text, SKUs and labels.
- Leave "Your value" blank for random test codes and set How many (1–20), or type your own number or text to get that one barcode.
- Pick a Bar size: Small, Medium or Large make the narrowest bar 2, 3 or 4 pixels wide.
- Click Generate Barcodes, then use Download PNG or SVG to save a barcode, or Print to print them one per page.
Use Cases
- •Testing a barcode scanner, POS terminal or inventory app with codes you know are valid
- •Printing Code 128 labels for your own bins, shelves, tools or storage boxes
- •Placing realistic barcodes on packaging mockups and product label designs
- •Checking that a hand-typed EAN-13 or UPC-A number has the right check digit before you use it
- •Creating test fixtures for warehouse, library or asset-tracking software
Tips
- →For printing or label software, download the SVG — it scales to any size without blurring the bars.
- →Keep the white space on both sides of the barcode when you crop or place it; scanners need that quiet zone to find the code.
- →Digits-only Code 128 values are encoded two digits per symbol, so an even number of digits gives a noticeably shorter barcode.
- →To test your app's check-digit validation, enter a full EAN-13 with the last digit changed — the error message shows the correct digit.
- →Some store systems treat EAN-13 codes starting with 2 as in-store or weighed items; if your POS does, test with your own value instead of a random code.
FAQ
Will these barcodes actually scan?
Yes. Every format is drawn to its specification — EAN-13 parity patterns, guard bars, quiet zones, and the Code 128 start, mod-103 check and stop symbols. We rendered hundreds of them at several sizes and decoded each one with the open-source ZXing barcode reader, and every barcode read back as its exact value. For printing, use the SVG or the 2× PNG so the bars stay sharp.
Can I use these barcodes on products I sell in stores?
Not the random ones. Retail barcodes must come from GS1, which assigns your company prefix so no two products share a number. The random EAN-13, UPC-A and EAN-8 codes here use the restricted-circulation ranges meant for in-store or internal use, so they are good for testing and mockups but are not registered products. If you already own GS1 numbers, type one in and this tool will draw it.
What is the difference between EAN-13, UPC-A, EAN-8 and Code 128?
UPC-A (12 digits) is the retail barcode used mainly in the US and Canada; EAN-13 (13 digits) is the international version, and a UPC-A is simply an EAN-13 starting with 0. EAN-8 is a shorter 8-digit code for small packages. Code 128 is not a retail product code: it can hold letters, digits and punctuation, which makes it the usual choice for shipping, warehouse, asset and inventory labels.
How is the check digit calculated?
For EAN-13, UPC-A and EAN-8, the digits are weighted 3, 1, 3, 1… starting from the right of the number without its check digit; the check digit is whatever brings the sum up to the next multiple of 10. Enter the number without its last digit and this tool adds it, or enter the full number and it tells you if the last digit is wrong and what it should be. Code 128 adds its own hidden mod-103 check symbol automatically.
Why does my scanner show 12 digits for an EAN-13 that starts with 0?
An EAN-13 whose first digit is 0 has exactly the same bars as the UPC-A made of the other 12 digits, so many scanners and apps report it as UPC-A. Both readings refer to the same number.
You might also like
Popular tools from other categories that share themes with this one.