Choosing the Right Symbology
"Barcode" is not one format. It is a family of encoding schemes called symbologies, and picking the wrong one is the most common reason a printed code will not scan where it needs to. Each was designed for a specific job, and most of them cannot encode what the others can.
| Format | Accepts | Designed for |
|---|---|---|
| Code 128 | Any text, any length | Logistics, internal asset tags, anything not sold at retail. |
| EAN-13 | 13 digits | Retail products worldwide outside North America. |
| EAN-8 | 8 digits | Small retail packaging where EAN-13 will not fit. |
| UPC-A | 12 digits | Retail products in North America. |
| Code 39 | Uppercase, digits, a few symbols | Older industrial, defence and automotive systems. |
| ITF-14 | 14 digits | Outer shipping cartons rather than the item inside. |
The practical shortcut: if you are labelling something for your own use, Code 128 is almost always the answer, because it takes arbitrary text and packs it densely. If the item will pass through a retail till, you need the format that matches its registered product number, and that is not a free choice.
Retail Codes Are Not Yours to Invent
EAN and UPC numbers are not arbitrary. They are issued through GS1, the organisation that administers the global numbering system, and a company buys a prefix that identifies it. The digits that follow identify the product within that company's range.
This matters because generating a valid-looking EAN-13 does not give you a usable retail barcode. It produces a number that either belongs to somebody else or belongs to nobody, and a retailer's system will reject it or, worse, ring up someone else's product. For a real product going into real shops, the number has to be allocated to you.
Where the generator is genuinely useful for retail formats is reproducing a barcode you already have, regenerating a damaged label, or producing a clean print-ready version of a number already assigned to your product.
The Check Digit Is Doing Real Work
EAN-13, EAN-8, UPC-A and ITF-14 all end in a check digit calculated from the digits before it. Alternating digits are weighted 1 and 3, the weighted total is summed, and the check digit is whatever brings that sum to the next multiple of ten.
Take 5901234123457. The weighted sum of the first twelve digits comes to 83, and 90 − 83 = 7, which is the final digit. Every scan recomputes this, which is why a scanner rejects a smudged or misread code instead of returning a plausible wrong number. If the generator refuses your input, a mistyped digit is the likeliest cause.
Code 128 and Code 39 have no user-visible check digit, which is part of why they accept free text, and also why a misread is caught by the symbology's internal structure rather than by arithmetic you can verify by eye.
Printing So It Actually Scans
Most scanning failures are printing failures rather than encoding failures.
- Quiet zone. Barcodes need blank margin on both sides, around ten times the width of the narrowest bar. Cropping tight to the bars is the single most common cause of a code that will not read.
- Contrast. Black on white. Scanners read reflected light, so red bars on a dark background can be invisible to them even though they look fine to you.
- Size. Scaling a barcode down past a certain point merges the narrow bars at print resolution. Print at the size you will use rather than shrinking afterwards.
- Distortion. Never stretch a barcode in one direction only. Height can be trimmed; width cannot be altered independently without changing the ratios the scanner measures.
Everything here runs in your browser using JsBarcode, so nothing you enter is uploaded. Download the result as an image and test-scan it with a phone before committing to a print run of several thousand labels.