Code 128 Barcode Generator
Free online barcode generator: create Code 128, EAN-8, EAN-13, QR Code, Micro QR, Data Matrix and PDF417, then export PNG, PDF or SVG — single codes or in bulk.
Also generates EAN-13, EAN-8, QR Code, Data Matrix and PDF417 — all in your browser.
- Generate Code 128, EAN-8, EAN-13, QR Code, Micro QR, Data Matrix, and PDF417
- Enter multiple values or generate random values for linear barcodes
- Export PNG images, PDFs, or SVG vector files
- Generate and export entirely in the browser
How to generate a Code 128 barcode
A Code 128 barcode generator lets you create a scannable barcode in seconds, without installing software. Open the BestNav barcode tool and confirm that Code 128 is selected; it is the default format and supports text and numbers. Type your value into the Barcode data box. The preview updates as you type, so you can check the result immediately and correct any mistake before exporting. If you have no value yet, use Generate random values to create one. Set the output size before downloading: the default is 8 cm wide and 3 cm high. When the preview looks correct, download the result as PNG, PDF, or SVG. Before printing a full batch, scan one printed copy with a phone or scanner. Code 128 is a high-density format, so it works well for inventory, logistics, asset labels, and FNSKU-style codes, where a compact barcode must store letters, numbers, and symbols reliably.
Which barcode type should you use
Choosing the right barcode starts with how and where it will be scanned. For internal stock, warehouse labels, parcels, and asset tracking, Code 128 is usually the best choice, because it stores letters, numbers, and symbols in a compact linear symbol and is widely supported by handheld scanners. Code 128 is readable by virtually all handheld scanners. For products sold in shops, use EAN-13 for standard packaging and EAN-8 for very small packs, because retail tills expect those formats and the codes are tied to a GTIN. For a website link, payment, ticket, or menu, use a QR Code, because customers can scan it with a phone camera without a special reader. For a small part, medical device, or component that needs a durable mark in limited space, use Data Matrix, which remains readable at a small size and includes strong error correction. PDF417 is useful when a larger amount of text must be stored on a document, such as a boarding pass or an ID card. A code that looks correct on screen can still fail if it is printed too small, too light, or too close to other graphics. Match the format to the use case, and re-check it whenever the product, packaging, or scanning equipment changes.
| Barcode type | Stores | Best for |
|---|---|---|
| Code 128 | Text and numbers | Inventory, logistics, asset labels |
| EAN-13 | 12 digits + check digit | Retail products |
| EAN-8 | 7 digits + check digit | Small retail packs |
| QR Code | Links, text, payments | Customers scanning with phones |
| Data Matrix | Compact data | Small parts, medical and industrial items |
| PDF417 | Larger text blocks | Documents, tickets, ID cards |
EAN-13 and EAN-8: retail barcodes for products
EAN-13 is the retail barcode used on most products sold in shops around the world. In the BestNav tool, you enter 12 digits, and the check digit is added to complete the 13-digit code. The resulting barcode identifies the product at the checkout and in stock systems, and it is linked to a GTIN-13 number. EAN-8 is the shorter alternative for small packaging where there is not enough space for a full EAN-13 symbol. You enter 7 digits, and the check digit completes the 8-digit code. Both formats are designed for fast, reliable scanning at retail tills, so the bars must be printed clearly, in black on white, at a size large enough for the scanner. Before printing a large run, test one copy to confirm that it scans cleanly. Use EAN-13 for standard retail products and EAN-8 only when space is genuinely limited. Always verify the check digit first.
Data Matrix and QR Code: 2D barcodes
Data Matrix and QR Code are two-dimensional barcodes, so they can store far more information than a one-dimensional barcode of the same size. A QR Code is the familiar square code used for website links, payments, menus, tickets, and contact details, because almost any phone camera can read it. A Data Matrix code is more compact and is often printed directly on small items, electronic parts, medical devices, and industrial components, where space is limited and durability matters. Both formats include error correction, which means they can still be read even if part of the symbol is damaged or dirty. When you generate a 2D code, keep the data short where possible, use a high-contrast print, and leave enough quiet space around the symbol. Always test the printed code with a real phone or scanner before using it on products. A short, clear code always scans faster and more reliably.
Bulk barcode generator: create many codes at once
A bulk barcode generator saves hours when you need many codes at once. Instead of creating each barcode separately, switch the BestNav tool from Single to Batch mode. Enter your list of values, then generate the set in one run. You can also use Generate random values for linear barcodes when you need a series of unique codes quickly. Keep the output size consistent across the batch, so every label prints at the same width and height. Before exporting, check the preview for missing values, duplicates, or typing errors, because one wrong character can make a whole label unscannable. Export the finished set as PNG, PDF, or SVG, depending on how you will print or share it. Because everything runs in your browser, your data stays on your own device. Batch generation is ideal for stocktaking, warehouse labels, product runs, and events where dozens or hundreds of codes are needed.
Export and print: PNG, PDF, SVG
Choosing the right export format really makes printing much easier. Download PNG when you need a simple image for a document, a web page, or a quick print. The tool notes that PNG uses 96 DPI, so it is best for on-screen use and small prints, not for large, high-resolution labels. Download SVG when you need a vector file that can be scaled to any size without losing sharpness. Download PDF when you need a print-ready file with the exact size in centimetres. SVG and PDF use the size you set, such as 8 cm by 3 cm, so check those dimensions before exporting. Always print at 100 percent, or Actual Size, and never use Fit to Page, because scaling can make the barcode too small to scan. Use black ink on white, non-reflective material, leave a clear quiet zone, and scan one test print before printing the full batch.
FAQ
Is this barcode generator free to use?
Yes. Generate Code 128, EAN, QR Code, Data Matrix, and PDF417 in your browser, without installing software or creating an account. Export as PNG, PDF, or SVG, and always test one printed copy first, because print size, ink, and paper can affect scanning.
Does my barcode data leave my browser?
No. Everything runs in your browser, and barcode data stays in this browser. Your values are not sent to a server, so you can safely use internal codes and stock numbers. Close the tab when you finish, and avoid sharing screenshots of codes.
What is the difference between Code 128 and EAN-13?
Code 128 is a barcode for internal use. It stores letters, numbers, and symbols, and it is common in warehouses. EAN-13 is a retail barcode with 12 digits plus a check digit, linked to a GTIN, for products sold in shops.
Can I generate many barcodes at once?
Yes. Switch from Single to Batch mode, enter your list of values, and generate the whole set together. You can also generate random values for linear barcodes when you need unique codes quickly. Check the batch for duplicates and typing errors before exporting.
Which file format should I download: PNG, PDF, or SVG?
Use PNG for an image or a document, because it is simple and widely supported. Use PDF for print-ready output, because it keeps the exact size in centimetres. Use SVG for professional design or large printing, because it stays sharp at any size.
Will my barcode scan after printing?
It should scan if it is printed correctly. Print at 100 percent, use black on white, keep the size large enough, and leave a clear quiet zone around the symbol. Avoid glossy paper, low ink, and scaling that shrinks the bars.
Enable JavaScript to use the interactive tools.