Barcodes Explained: EAN, UPC, Code 128 and Code 39
Web & SEO · October 17, 2026 · 2 min read
A barcode is a pattern of bars that a scanner turns back into a number or text. There are different types for different jobs, and the wrong one gives you a label that no scanner can read.
The main types
- EAN-13: 13 digits, used on products sold in shops in most of the world.
- UPC-A: 12 digits, used on products in the United States and Canada. An EAN-13 starting with 0 is the same as a UPC-A.
- EAN-8: 8 digits, for packages too small for a full code.
- Code 128: any letters, numbers and symbols, compact and common for shipping and inventory.
- Code 39: capital letters, numbers and a few symbols, common in industry and on ID badges.
What the digits mean
In EAN-13 the first digits identify the company that registered the code, the next ones identify the product, and the last digit is a check digit. The check digit catches typing and scanning errors. To work it out, multiply the digits by 1 and 3 alternately, starting with 3 on the digit closest to the check digit, add them up, and take the amount needed to reach the next multiple of ten. For 400638133393 that gives 1.
Making one
The Barcode Generator draws all five types, adds the check digit for you, and downloads a PNG or a sharp SVG for printing. Shops and marketplaces need numbers registered with GS1, the organization that manages product numbers, and a tool can't register a number for you, so use your own codes for internal labels.
Printing barcodes that scan
- Use dark bars on a light background, and keep a blank margin, called the quiet zone, on both sides.
- Don't stretch or squash the barcode, and don't make it very small.
- Print at a high resolution, or use the SVG.
- Test with a real scanner or phone before printing a large batch.
Barcode or QR code?
A barcode is read along one line and holds a short number. A QR code is read in two directions and can hold links, Wi-Fi details and contact cards. Choose a barcode when a till or warehouse scanner expects one, and a QR code for people scanning with their phone.