Barcodes aren't one universal format — the five common types each follow different rules, and picking the wrong one for the job is the most common reason a printed barcode doesn't scan.
The five types, and what each is actually for
- CODE 128 — encodes any text (letters, numbers, symbols), no fixed length. The right default for internal use: asset tags, warehouse tracking, internal SKUs, ticket numbers — anything that isn't a retail product hitting a standard store scanner.
- CODE 39 — an older format, uppercase letters and numbers only. Still common in logistics and some legacy inventory systems, but more limited than CODE 128 for new projects.
- EAN-13 — exactly 13 digits. The standard retail barcode used across most of the world outside North America — this is what's actually printed on products on store shelves internationally.
- EAN-8 — exactly 8 digits. A shortened EAN variant for very small packaging where a full EAN-13 doesn't physically fit.
- UPC-A — exactly 12 digits. The standard retail barcode in the United States and Canada.
Why the digit counts are strict, not a suggestion
EAN-13, EAN-8, and UPC-A require an exact digit count — 13, 8, and 12 respectively — because these formats end with a checksum digit calculated from the ones before it, and retail scanners verify that checksum before accepting a scan. A code with the wrong digit count isn't just unusual, it's structurally invalid for that format and won't scan at all, which is why our Barcode Generator checks the digit count upfront and tells you immediately, rather than generating an image that looks fine but fails at the register.
Picking the right one for your actual use case
If the barcode needs to work with a real retail point-of-sale scanner and you're selling a physical product, you need EAN-13, EAN-8, or UPC-A — and you'll typically be assigned that number by a barcode registration authority (GS1), not choose it arbitrarily. If it's for internal tracking, an event ticket, or anything not going through third-party retail infrastructure, CODE 128 is usually the simplest correct choice, since it can encode arbitrary text without a fixed digit count.
Using the tool
Choose a barcode type, enter the text or digits it requires, and download the result as a PNG — with adjustable width and height, and an option to show or hide the human-readable text under the bars. Try it here: Barcode Generator.