Barcode Generator
A barcode generator converts text or numeric data into standardized barcode images that can be scanned by barcode readers. Barcodes are essential in retail, logistics, inventory management, and product identification — encoding information in a pattern of parallel lines of varying widths.
This tool supports three widely-used barcode formats: Code 128 for general-purpose alphanumeric encoding, EAN-13 for international product identification, and UPC-A for North American retail products. Generate barcodes instantly, preview them live, and download as SVG or PNG for print or digital use.
How it works
Code 128 encodes each ASCII character (32–126) as a pattern of bars and spaces, with a modulo-103 checksum. EAN-13 uses a 12-digit payload plus a check digit calculated by alternating ×1 and ×3 weights. UPC-A encodes 11 data digits plus a check digit using alternating ×3 and ×1 weights. All formats include start/stop patterns and guard bars for scanner synchronization.
Use cases
- Generating product barcodes for retail packaging and inventory labels
- Creating Code 128 barcodes for shipping labels and logistics tracking
- Producing EAN-13 or UPC-A codes for product registration and cataloging
- Designing barcode labels for asset tracking and warehouse management
Frequently asked questions
What is the difference between Code 128, EAN-13, and UPC-A barcodes?
Code 128 is a general-purpose format that encodes any ASCII character, making it ideal for shipping labels and internal tracking. EAN-13 is the international retail standard that encodes 13 digits, while UPC-A is its North American counterpart with 12 digits. If you need letters or symbols, use Code 128; for retail products, use EAN-13 or UPC-A.
How is the check digit of an EAN-13 barcode calculated?
The check digit is computed from the first 12 digits by multiplying them alternately by 1 and 3, summing the results, and taking the amount needed to reach the next multiple of 10. Scanners recalculate this digit on every read to detect errors. This generator computes it automatically, so you only need to enter the data digits.
Can I use a free barcode generator for products sold in stores?
You can generate the barcode image for free, but the number itself must be valid. Retail products need an official GS1 company prefix so that your EAN-13 or UPC-A number is globally unique. For internal use — inventory, assets, shipping — you can freely use any Code 128 value without registration.
Should I download my barcode as SVG or PNG for printing?
SVG is the best choice for print because it is a vector format that stays sharp at any size and resolution. PNG works well for digital documents, e-commerce listings, or quick tests. Whichever you choose, avoid stretching the image unevenly, as distorted bar widths can make the code unreadable.
Why won't my barcode scan correctly?
The most common causes are printing too small, low contrast between bars and background, and missing quiet zones — the blank margins on each side of the code. Also verify that the data matches the format: EAN-13 and UPC-A only accept digits, while Code 128 accepts ASCII characters 32 to 126. Reprinting at a larger size with pure black bars on white usually fixes scanning issues.