EAN-13, UPC-A or Code 128? Choosing the right barcode
Which barcode to use, how the check digit works, and the mistakes that only show up at the scanner.
2026-11-29
Three families, three jobs
Retail checkout reads EAN-13 in most of the world and UPC-A in North America. Both encode a fixed number with a check digit; the bars carry no product name, price or stock level. Internal labels — shelves, boxes, assets, patient files — usually use Code 128, which fits letters and punctuation into a shorter symbol, or Code 39 when an older scanner is involved.
EAN-8 exists for small packages where a 13-digit symbol would not fit. It is not a short version you can invent; the number still comes from the same issuing authority.
The check digit is arithmetic, not a suggestion
For EAN-13 the first 12 digits are the payload. Starting from the rightmost payload digit, multiply by 3, then 1, alternating; add everything, and the digit that brings the total to the next multiple of ten is the check digit. For 590123412345 the sum is 83, so the full code is 5901234123457.
Type 12 digits into a generator and it will usually append the correct one. Type 13 digits with the wrong check digit and the symbol is invalid even if it looks fine on screen. A scanner will reject it or read a different number, which is worse.
Do not invent retail numbers
Numbers beginning with 690–699, 45–49 and similar prefixes belong to GS1 member companies. Using one for a product you made up can collide with a real item and send stock or recalls to the wrong place. GS1 issues prefixes for a fee; that is the only legitimate route for retail.
For internal use, skip EAN entirely and use Code 128 or Code 39. You are not pretending to be a retail product, and you can encode purchase orders, locations or serials with letters.
Size and contrast decide whether it scans
A barcode needs quiet space on both sides — roughly ten narrow bars wide — or the scanner cannot find the start and stop pattern. Printing it edge-to-edge in a layout is a common reason a label works on screen and fails on paper.
Keep dark bars on a light background and avoid glossy or curved surfaces. As a rule of thumb, test at 80% of the intended print size; if it still scans, the real label has margin. Phones read surprisingly well, laser scanners are less forgiving.
Test one label before the print run
Print a single label on the actual printer and scan it with the actual scanner. Check the decoded text on screen, not just the beep. A wrong but valid code beeps exactly like the right one.
Our generator exports PNG for quick labels and SVG for print, where it stays sharp at any size. Batch mode takes one code per line and returns a ZIP. Lines with the wrong length or an invalid check digit are skipped rather than turned into a broken symbol.