What is a barcode?
A barcode encodes data as a series of parallel bars of varying widths that scanners can read optically. The pattern of bars and spaces represents numbers or characters according to a specific encoding standard.
Barcodes are used everywhere: retail pricing, shipping labels, library books, ID cards, boarding passes, and inventory management. Different industries use different barcode formats depending on their specific requirements.
Major barcode formats explained
Code 128
The most versatile linear barcode. Encodes all 128 ASCII characters — letters, numbers, and symbols. Variable length. Used for shipping labels, internal inventory, and any application requiring alphanumeric data.
Use when: Your data includes letters or mixed characters. No data length restriction. This is the default choice for most applications.
EAN-13 (European Article Number)
13-digit standard for retail product identification worldwide (outside North America). The first 2-3 digits identify the country/company, the middle digits identify the product, and the last digit is a check digit automatically calculated.
Use when: Selling products internationally or in European markets. Required for products scanned at retail checkout outside North America.
UPC-A (Universal Product Code)
12-digit standard used primarily in North America. The first 6 digits are the manufacturer code, next 5 are the product code, and the last is a check digit.
Use when: Selling products in US and Canadian retail stores. Required by major retailers like Walmart, Target, and grocery chains.
EAN-8
Compressed 8-digit version of EAN-13 for small packages where a full barcode won't fit.
Use when: Packaging is too small for EAN-13. Common on candy bars, small cosmetics, and cigarettes.
Code 39
Older alphanumeric barcode. Less efficient than Code 128 (each character requires more width). Still used in older industrial and government systems.
Use when: Compatibility with legacy systems that don't support Code 128.
QR Code
Two-dimensional code that can store much more data than linear barcodes — up to 4,296 characters. Can encode URLs, contact information, WiFi credentials, and more.
Use when: Linking to digital content. QR codes are designed to be scanned by smartphones, not traditional barcode scanners.
Check digits explained
EAN-13, EAN-8, and UPC-A barcodes include a check digit — the last digit — calculated from the other digits using a specific formula. Scanners use this to verify the barcode was read correctly.
EAN-13 check digit calculation:
- Multiply alternating digits by 1 and 3
- Sum all results
- Subtract from next multiple of 10
- Result is the check digit
The barcode generator calculates this automatically — you only need to enter the first 12 digits (for EAN-13) or 11 digits (for UPC-A).
Image format: SVG vs PNG
Download as SVG
SVG (Scalable Vector Graphics) is a vector format — the barcode will be crisp and sharp at any size, from business card to billboard. Use SVG for:
- Print materials
- Product labels
- Any professional printing
Download as PNG
PNG is a raster format — resolution is fixed at the time of generation. Use PNG for:
- Digital displays
- Email attachments
- Web pages
- Documents
For printing, always use SVG. A 72 DPI PNG barcode that looks fine on screen will appear blurry when printed.
Barcode size requirements
Most retail scanners need barcodes of specific minimum sizes to be scannable:
| Format | Minimum width | Recommended |
|---|---|---|
| EAN-13 | 25.9mm | 37.29mm |
| UPC-A | 25.9mm | 37.29mm |
| Code 128 | Depends on data | 15mm+ height |
| EAN-8 | 16.7mm | 21.64mm |
Always test scan your barcode before printing in bulk.
How to generate barcodes free
- Go to Barcode Generator
- Select your barcode format (Code 128 for most uses)
- Enter your data
- Adjust size, colors, and display options
- Download as SVG for print-quality output