Types of barcodes and how they work
What is a barcode?
A barcode is a pattern of dark bars and light spaces that stores a number or short text so a scanner can read it in a fraction of a second. Linear (1D) barcodes such as UPC, EAN and Code 128 hold one line of data; 2D codes such as QR codes hold more in a square grid.
How do barcodes work?
A scanner shines light — a laser on many checkout readers, or a camera on a phone or imager — across the symbol. Dark bars reflect less light than the light spaces. The widths of those bars and spaces are mapped back to characters according to the rules of the symbology, such as UPC-A or Code 128. Start and stop patterns tell the reader where the data begins and ends, and a check character or check digit lets it confirm that the read is complete and well formed. The scanner then sends only that number or text to the till or warehouse system. Price, product name and stock level come from the shop's own database, not from inside the bars. That is why two shops can sell the same packaged item at different prices from the same barcode.
The main barcode types at a glance
| Type | Data | Typical use | On this site |
|---|---|---|---|
| UPC-A | 12 digits | US and Canada retail | UPC generator |
| EAN-13 | 13 digits | Retail outside North America | EAN-13 generator |
| ISBN | EAN-13 starting 978 or 979 | Books | ISBN barcode |
| Code 128 | ASCII text and numbers | Shipping and inventory labels | Code 128 generator |
| GS1-128 | Code 128 with GS1 Application Identifiers | Supply chain | Not generated here as structured GS1-128; see Code 128 and GS1-128 |
| Code 39 | Uppercase letters, digits, a few symbols | Older industrial and government systems | Code 39 generator |
| ITF-14 | 14 digits | Cartons | Not on this site |
| QR code | 2D, URLs and text | Links and information for phone cameras | Not on this site |
| Data Matrix | 2D | Small parts and healthcare | Not on this site |
1D vs 2D barcodes
A 1D, or linear, barcode is a single row of bars. It holds a short value — a dozen digits for a retail GTIN, or a modest string of text in Code 128 — and can be read by a simple laser scanner as well as a camera. A 2D code, such as a QR code or Data Matrix, stores data in a grid and usually needs an imager. That extra capacity is useful for a web address, a batch of fields or a small amount of text, but it is not a substitute for a retail UPC or EAN at a supermarket checkout, where the till expects a GTIN in a linear symbol.
QR code vs barcode
A QR code is a 2D barcode. It can store up to a few thousand characters, enough for a URL or a short message, whereas a UPC holds twelve digits. Phones and imagers read QR codes; a basic laser checkout scanner often cannot. Use a QR code when people will point a phone camera at a poster, packaging insert or ticket to open a link. Use UPC-A or EAN-13 when a shop will scan a product at the till. This site makes linear barcodes only — UPC-A, EAN-13, Code 128, Code 39 and ISBN — and does not generate QR codes.
Code 39 vs Code 128
Code 128 is denser, so the same data usually produces a shorter symbol. It encodes all 128 ASCII characters, including lowercase letters, and always includes a modulo-103 check character added by the encoder. Code 39 encodes uppercase letters, digits and seven symbols, is wider for the same message, and treats a modulo-43 check as optional. Choose the symbology the receiving system already requires. For new internal labels, Code 128 is the usual choice, unless a customer or an older scanner setup specifies Code 39.
UPC vs EAN
UPC-A is the 12-digit retail symbol used mainly in the United States and Canada. EAN-13 is the 13-digit symbol used in most other countries. Modern scanners read both, and a UPC-A number can be written as an EAN-13 by adding a leading zero. The longer comparison, including what not to truncate, is on the UPC versus EAN section of the UPC generator page.
Which barcode should I use?
If you sell in retail stores, use UPC-A in the US and Canada or EAN-13 elsewhere, with a number licensed from GS1. For books, use an ISBN barcode and an ISBN issued by your national ISBN agency (Bowker in the US). For your own stock, assets, files or shipping labels, Code 128 is compact and can carry the text your software already uses. If a legacy system specifies a symbology, follow that specification — it is often Code 39. When people will scan a link with a phone, use a QR code from a QR tool; this site does not provide one.
Barcode types FAQ
Can I create my own barcode?
Yes. You can make a barcode for any number or text your own system uses, for example Code 128 labels for inventory. For products sold in stores you also need a UPC or EAN number licensed from GS1; the barcode image itself can be made free on this site.
Should I use EAN or UPC?
Use whichever your retailers ask for. UPC-A is standard in the US and Canada and EAN-13 in most other countries. Scanners worldwide read both, and a UPC number can be written as an EAN-13 by adding a leading zero.
What is a GTIN vs UPC?
GTIN is the umbrella name for GS1 product numbers. A UPC-A number is a GTIN-12, an EAN-13 number is a GTIN-13. The UPC or EAN is the barcode format that shows the GTIN on the package.
What is the best type of barcode to use?
For retail products, UPC-A or EAN-13 because stores require them. For your own inventory, assets or shipping labels, Code 128 is compact and reads almost any text. Choose QR codes when people will scan with phones to open a link.
Method and transparency
Last updated: 20 November 2026.