Skip the research. Find your use case below.
Linear barcodes store data in a single row of vertical bars and spaces. They have been the standard for retail and logistics since the 1970s. If you are working with physical products, shipping, or inventory, one of these formats is probably what you need.
The universal workhorse
If you are not sure which barcode to use, start here. Code 128 handles any combination of letters, numbers, and symbols with no fixed length. It produces compact, high-density barcodes that work with virtually every scanner on the market.
When to use it
You need a barcode for internal operations - inventory labels, asset tags, work orders, shipping labels, or anything that does not require a standardized retail product number.
Data
Letters, numbers, symbols
Length
Variable (no limit)
Check
Automatic (Mod 103)
The retail standard in North America
Walk into any store in the United States or Canada and pick up a product. The barcode on it is almost certainly UPC-A. This 12-digit format has been the backbone of retail since 1974 when the first UPC was scanned on a pack of Wrigley's chewing gum in Ohio.
When to use it
You are selling a physical product through retail stores in the US or Canada. Retailers require UPC-A barcodes for point-of-sale scanning. You will need a GS1 company prefix to get a unique number.
Data
Numbers only
Length
Exactly 12 digits
Check
Built-in (last digit)
The global version of UPC
EAN-13 is the international equivalent of UPC-A. It uses 13 digits instead of 12, with the extra digit representing the country of origin. Every UPC-A barcode is technically an EAN-13 with a leading zero. If you are selling products outside North America, this is your format.
When to use it
You are selling products in Europe, Asia, South America, Africa, or Australia. International retailers and marketplaces require EAN-13. Like UPC-A, you need a GS1 prefix.
Data
Numbers only
Length
Exactly 13 digits
Check
Built-in (last digit)
For products too small for a full barcode
Some products are physically too small to fit a standard EAN-13 or UPC-A barcode. Lip balm tubes, candy bars, small cosmetics - when the packaging is tiny, EAN-8 gives you a scannable barcode in half the space. It uses 8 digits and produces a noticeably shorter barcode.
When to use it
Your product packaging is too small for a full-size barcode. EAN-8 numbers are assigned directly by your local GS1 office (you cannot derive them from your company prefix).
Data
Numbers only
Length
Exactly 8 digits
Check
Built-in (last digit)
The government and military standard
Code 39 is one of the oldest barcode formats still in wide use. It is the required format for the US Department of Defense (MIL-STD-1189) and is used across government agencies, military logistics, and automotive manufacturing. Its main advantage: it is self-checking, meaning it does not require a check digit.
When to use it
You work with government contracts, military supply chains, or the automotive industry. Code 39 is also common in libraries and older inventory systems.
Data
Letters (A-Z), numbers, some symbols
Length
Variable
Check
Optional (self-checking)
Built for shipping cartons
ITF-14 is specifically designed for marking outer shipping cartons and cases, not individual products. The "ITF" stands for Interleaved Two of Five - it encodes digits in pairs, which makes it efficient but limits it to numbers only. The thick bars print well on corrugated cardboard, which is why logistics companies prefer it.
When to use it
You are labeling shipping cases, pallets, or outer cartons that contain multiple products inside. The ITF-14 identifies the case, while the products inside have their own UPC-A or EAN-13 barcodes.
Data
Numbers only
Length
Exactly 14 digits
Check
Built-in (last digit)
Two-dimensional barcodes store data in a grid instead of a single line. They hold far more information and can be scanned by smartphone cameras. QR codes are the most well-known, but Data Matrix and PDF417 serve critical roles in healthcare, manufacturing, and government.
Tiny items, massive data
Data Matrix is a 2D barcode that can be printed as small as 2mm x 2mm while remaining scannable. The electronics industry uses it to mark individual components like resistors and chips. Healthcare uses it on surgical instruments, medication vials, and lab samples. It is also the format required by the US FDA for unique device identification (UDI) on medical devices.
When to use it
You need to mark very small items, or you work in an industry that requires Data Matrix specifically (electronics manufacturing, medical devices, pharmaceutical serialization).
Data
Any (text, numbers, binary)
Capacity
Up to 2,335 characters
Error correction
Reed-Solomon error correction
The identity document format
PDF417 is a stacked barcode that stores data across multiple rows. It can hold up to 1,850 characters - enough for a paragraph of text or a set of biometric data. Look at the back of your driver's license: that is a PDF417 barcode. Airlines use it on boarding passes. Government agencies use it on official documents.
When to use it
You need to encode large amounts of data in a scannable format, typically for identity documents, tickets, or passes. PDF417 has built-in error correction, so it scans even when partially damaged.
Data
Any (text, numbers, binary)
Capacity
Up to 1,850 characters
Error correction
Reed-Solomon error correction
Looking for QR codes?
Create QR codes for URLs, WiFi, contact cards, email, and SMS on our sister site QRCodeGenerator.to.
All barcode formats at a glance. Compare data capacity, use cases, and requirements.
| Format | Type | Data | Length | Best for |
|---|---|---|---|---|
| Code 128 | 1D | Letters, numbers, symbols | Variable (no limit) | Warehousing, Logistics |
| UPC-A | 1D | Numbers only | Exactly 12 digits | Retail (US/Canada), Grocery |
| EAN-13 | 1D | Numbers only | Exactly 13 digits | International Retail, Export |
| EAN-8 | 1D | Numbers only | Exactly 8 digits | Cosmetics, Confectionery |
| Code 39 | 1D | Letters (A-Z), numbers, some symbols | Variable | Government, Military (DoD) |
| ITF-14 | 1D | Numbers only | Exactly 14 digits | Shipping, Distribution |
| Data Matrix | 2D | Any (text, numbers, binary) | Up to 2,335 characters | Electronics, Medical Devices |
| PDF417 | 2D | Any (text, numbers, binary) | Up to 1,850 characters | Government IDs, Airlines |
Barcodes are older than most people realize. The first patent was filed in 1952, over 70 years ago. Here is how each format came to exist.
Norman Woodland and Bernard Silver patented a "bull's eye" barcode using concentric circles. The technology was ahead of its time. Reliable laser scanners would not exist for another two decades.
A pack of Wrigley's Juicy Fruit chewing gum was the first product scanned with a UPC barcode, at a Marsh supermarket in Troy, Ohio. That pack of gum is now in the Smithsonian.
The European Article Number system launched as the international counterpart to UPC. It added a 13th digit for country codes, allowing products from different countries to coexist in the same retail system.
Computer Identics Corporation released Code 128, the first barcode format to support the full ASCII character set. It quickly became the standard for logistics and inventory because it could encode both letters and numbers efficiently.
The DoD mandated Code 39 (MIL-STD-1189) for marking all military equipment and supplies. Code 39 had been created in 1974 by Intermec, but military adoption made it an industry standard overnight.
Masahiro Hara at Denso Wave (a Toyota subsidiary) created the QR code to track automotive parts during manufacturing. The key innovation was the three finder patterns in the corners, which let scanners detect the code at any angle. Denso Wave chose not to enforce their patent, making QR codes free to use worldwide.
The U.S. FDA began requiring unique device identification (UDI) on medical devices using Data Matrix barcodes. The format's ability to print as small as 2mm x 2mm made it the only practical choice for marking surgical instruments and implants.
Contactless menus during the pandemic pushed QR codes into everyday use. Today, GS1 is leading the transition from 1D barcodes to 2D codes (GS1 Digital Link) on retail products, which would let shoppers scan a product with their phone to get pricing, nutrition facts, and origin information.
A barcode is a pattern of bars (dark) and spaces (light) of varying widths. A scanner shines a light across the barcode and measures the reflections. Dark bars absorb light, light spaces reflect it. The scanner converts these reflections into electrical signals and decodes them into characters.
Every barcode has three structural parts: a start character that tells the scanner which format it is reading, the data characters in the middle, and a stop character that signals the end. Some formats also include a check digit at the end, which is a number calculated from the other digits. The scanner recalculates this number and compares it to verify the barcode was read correctly.
The blank space on either side of the barcode is called the quiet zone. Scanners need this margin to identify where the barcode starts and ends. If you crop the quiet zone, the barcode will fail to scan. Our generator adds the correct quiet zone automatically.
Quiet zone (left)
At least 9 modules of blank space. Required for the scanner to detect the start.
Start guard pattern
Three bars (bar-space-bar) that signal the beginning of data.
Number system digit
The first digit. For most products this is 0. Coupons use 5, pharmacy items use 3.
Manufacturer code (5 digits)
Assigned by GS1 to identify the company that makes the product.
Center guard pattern
Five bars (space-bar-space-bar-space) that split the barcode into left and right halves.
Product code (5 digits)
The specific product number within the manufacturer's catalog.
Check digit
Calculated from all other digits using a modulo-10 algorithm. Catches scanning errors.
End guard + quiet zone (right)
Three bars to signal the end, followed by 9 modules of blank space.
A barcode generator creates the image. But the number inside the barcode has to come from somewhere. For retail products, that somewhere is GS1.
GS1 is a global nonprofit that manages barcode numbering standards. They have offices in over 100 countries. When a company wants to sell products at retail, they apply for a GS1 company prefix. That prefix becomes the first part of every UPC or EAN barcode the company creates.
The system works because GS1 guarantees that no two companies get the same prefix. Your prefix combined with your product numbers creates a globally unique identifier. A scanner in a Tokyo convenience store can read a barcode from a factory in Ohio because both use the same GS1 numbering system.
GS1 membership costs vary by country and company size. In the US, initial registration starts around $250 plus an annual renewal fee. The membership gives you a company prefix and the ability to assign barcode numbers to your products.
You DO need GS1 for:
You do NOT need GS1 for:
Our generator creates the barcode image, not the number. Enter any valid data and we will render it as a barcode. If you need a unique product number for retail, get it from GS1 first, then come back to generate the image.
A barcode is only useful if it scans reliably. These are the physical requirements that matter when you move from screen to print.
Scanners need high contrast between bars and background. Black on white is the safest combination. Dark colors on light backgrounds work. Light on light or dark on dark will fail.
Avoid red or orange bars. Many laser scanners use red light, which means red bars reflect the same way as white spaces. The scanner cannot tell the difference.
Metallic, glossy, or reflective packaging can cause scanning issues. If your packaging is reflective, print the barcode on a matte white label and apply it to the product.
Laser scanners read 1D barcodes only. They project a thin line of laser light across the barcode. Fast and reliable for retail checkout.
Area imagers capture a 2D image of the barcode. They read both 1D and 2D formats (QR codes, Data Matrix). Standard in modern warehouses.
Smartphone cameras work best with QR codes. They can read some 1D barcodes but results depend on the phone model and lighting conditions.
Always test before printing at scale. Print a sample barcode at your intended size and scan it with the actual scanner your customers or warehouse workers use. Test at different angles and distances. A barcode that looks perfect on screen can fail in the real world if the print quality, size, or contrast is wrong.
Different industries have settled on different formats. Here is what is standard in each one.
UPC-A on every product. EAN-8 for small items. ITF-14 on shipping cartons. GS1 membership required.
EAN-13 on every product. Same system as UPC but with 13 digits. Required for selling in Europe, Asia, and most other markets.
Code 128 for shelf labels, pick lists, and tracking numbers. ITF-14 on outer cartons. Area imager scanners can read both.
Data Matrix for medical devices (FDA UDI requirement). Code 128 for lab samples and patient wristbands. Scanning prevents medication errors and mix-ups.
Code 39 is the DoD standard (MIL-STD-1189). Used on all military equipment, government property tags, and federal documents.
QR codes for digital menus, WiFi access, reservation links, and contactless payment. Print them on table tents, receipts, or door signs.
Common questions about barcode types and formats.
Pick your format, enter your data, download as PNG or SVG. Free, instant, no account needed.