Barcode Types Explained: Code 128, EAN-13 and UPC-A
Which barcode to use for products, logistics and inventory, plus check digits, quiet zones, print size and what to know before putting one on a product.
How is a barcode different from a QR code?
A barcode is a one-dimensional code that stores data in the widths of horizontal bars. It holds little data, but it is simple, so checkout scanners read it very quickly. A QR code is two-dimensional and is better for links and longer text.
Use a barcode when a short value, such as a product or stock number, is read by a laser or infrared scanner. Use a QR code when people should open a link with a phone.
The main types
- Code 128: handles upper and lower case letters, digits and symbols (ASCII) at any length. It is the most common choice for logistics, inventory, asset tags and shipping labels.
- EAN-13: the 13-digit numeric barcode on products in Europe and most of the world. The last digit is a check digit.
- UPC-A: the 12-digit numeric barcode used on products in the US and Canada. Adding a leading 0 makes it read the same way as EAN-13.
- EAN-8: a short 8-digit barcode for very small packages.
What is a check digit?
The last digit of an EAN or UPC is calculated from the digits before it. It catches typing mistakes and misreads by the scanner.
In QR Tree you only enter 12 digits for EAN-13, 7 for EAN-8 and 11 for UPC-A, and the check digit is added automatically. If you type the check digit yourself and it is wrong, we show the correct one.
Before you put one on a product
- EAN and UPC numbers for products sold in stores or online marketplaces must be built on a company prefix issued by GS1. A number you invent can collide with another company's product.
- For practice, internal inventory or event tickets that never leave your organization you can make any number you like.
- Code 128 can be used for internal purposes without a GS1 prefix.
Print checklist
- Use dark bars on a light background. Red bars, or bars lighter than the background, may not be read by infrared scanners.
- Do not crop the blank margins on both sides of the bars. Without them the scanner cannot find the start.
- The nominal size of EAN-13 is about 37 mm wide including margins. It is normally used between 80% and 200%, and printing it too small can make it unreadable.
- Scale it proportionally and never stretch it. Saving as SVG keeps it sharp at any size.
- Always test a printed barcode with a real scanner or a phone app before using it.
Related tools
Related guides
- How to Choose QR Code Print Size and ResolutionHow big does a QR code need to be printed to scan well? A checklist covering minimum size, margin, color contrast and when to choose PNG or SVG.
- QR Error Correction: How to Choose L, M, Q or HHigher error correction lets a QR code scan even when damaged, but adds cells. Learn L, M, Q and H and how to choose when adding a logo.