Barcode types explained
Compare EAN-13, UPC-A, Code 128, Code 39 and ITF barcodes. Learn which type to use for retail, shipping or inventory and how check digits catch scan errors.
Linear barcodes in one minute
A linear (1D) barcode stores data in the widths of black bars and white spaces. A scanner reads across the bars, decodes the pattern and returns a short string of digits or characters. Different symbologies trade off which characters they can store, how compact they are and where they are accepted. Choosing the wrong one can mean a product that will not scan at checkout or a label your warehouse system rejects.
Unlike a QR code, a linear barcode usually stores only an identifier, such as a product number. The meaning, like price or description, lives in a database that the scanner's software looks up.
EAN-13 and EAN-8: retail products worldwide
EAN-13 is the standard retail barcode outside North America and is accepted by retailers worldwide. It encodes 13 digits: a GS1 company prefix, a product reference and a final check digit. EAN-8 is a shorter 8-digit version for very small packages where an EAN-13 will not fit.
Retail numbers are not something you make up. To sell through stores, you license a company prefix from GS1, the organization that manages these numbers, and assign product numbers from it. A barcode generator draws the symbol; it does not register the number.
UPC-A and UPC-E: retail in North America
UPC-A is the 12-digit barcode used on products in the United States and Canada. It is closely related to EAN-13: a UPC-A number is equivalent to an EAN-13 with a leading zero, and modern point-of-sale scanners read both. UPC-E is a compressed 8-digit form for small items. It works only for certain numbers that contain runs of zeros, which the scanner expands back to the full UPC-A.
Code 128: logistics and general use
Code 128 can encode all 128 ASCII characters: upper and lower case letters, digits, punctuation and control characters. It is compact, especially for long runs of digits, which it packs two per symbol. That makes it a common choice for shipping labels, internal asset tags, serial numbers and inventory systems. GS1-128, used on pallets and cases in supply chains, is built on Code 128 with standardized data fields.
Every Code 128 barcode includes a mandatory check character calculated from the data. The generator adds it automatically and scanners verify it, so you never type it yourself and it does not appear in the scanned result.
Code 39: simple and widely supported
Code 39 is an older symbology still used in manufacturing, defense, healthcare and ID badges. It supports 43 characters: digits, upper case letters A to Z, space and the symbols - . $ / + %. It needs no check digit to be reliable, although one can be added. The trade-off is size: Code 39 is much wider than Code 128 for the same data, so it suits short codes on labels with plenty of room.
ITF: cartons and cases
ITF (Interleaved 2 of 5) encodes digits only, in pairs, so the data must have an even number of digits. Its best-known use is ITF-14, the 14-digit code printed on corrugated shipping cartons. ITF tolerates rough printing on cardboard well, which is why it is used where an EAN would smudge.
Which barcode should you use?
- Selling a product in stores worldwide: EAN-13 with a GS1-licensed number.
- Selling in the US or Canada: UPC-A, also from GS1.
- Very small retail packages: EAN-8 or UPC-E.
- Shipping labels, asset tags, serial numbers, internal inventory: Code 128.
- Legacy systems or partners that require it: Code 39.
- Outer shipping cartons: ITF-14.
- Links, contact details or more than a short ID: a QR code instead.
How check digits work
EAN and UPC codes end with a check digit that catches most typing and scanning errors. It is calculated from the other digits with a simple modulo 10 rule:
- Starting from the rightmost digit of the number without its check digit, multiply digits alternately by 3 and 1.
- Add up the results.
- The check digit is the amount needed to reach the next multiple of 10. If the sum is already a multiple of 10, the check digit is 0.
For example, the 12 digits 400638133393 give a check digit of 1, so the full EAN-13 is 4006381333931. For UPC-A, 03600029145 gets a check digit of 2, making 036000291452. If one digit is misread, the sum changes and the scanner rejects the code instead of returning the wrong product.
Create a barcode in your browser
- Open the barcode generator and choose a type: Code 128, EAN-13, EAN-8, UPC-A, UPC-E, Code 39 or ITF.
- Enter your data. For EAN and UPC you can leave out the check digit and it will be calculated for you.
- If you include a check digit and it is wrong, the tool tells you which digit it should be.
- Choose whether to show the human-readable text below the bars, set the colors, and adjust the scale from 1x to 10x.
- Download a PNG, or an SVG for print and packaging artwork.
Printing and scanning tips
- Keep a clear margin on both sides of the bars; scanners need it to find the start and end.
- Print dark bars on a light background. Red bars are invisible to many laser scanners.
- Do not squash or stretch the barcode horizontally after export. Scale it proportionally.
- Test the printed label with the scanner your store or warehouse actually uses.
To check an existing barcode, take a clear photo and open it in our barcode reader, or point your camera at it. It reads the code locally and shows the format and the decoded value.
Barcode readerRead a barcode from a photo or your camera, without uploading anything.