Which barcode do you actually need?

If the product will be scanned at a retail till, you need an EAN-13 or UPC-A built from a number issued to your company by GS1 — you cannot invent one. If the code is for your own stock, shelves, assets or shipping, use Code 128 with whatever text you like, because nothing outside your organisation will ever read it.

That single question — will a stranger scan this? — settles the choice almost every time.

What are the options?

Six symbologies cover essentially all of it.

Symbology Holds Used for
EAN-13 13 digits Retail outside North America
UPC-A 12 digits Retail in North America
EAN-8 8 digits Packages too small for EAN-13
ITF-14 14 digits Outer cases and cartons
Code 128 Any ASCII text Internal stock, logistics, labels
Code 39 Letters, digits, a few symbols Older industrial and automotive systems

UPC-A and EAN-13 are the same code underneath: a UPC-A is an EAN-13 whose first digit is zero, and the bar patterns are identical. A scanner that reads one reads the other, which is why North American products scan in European shops.

Why can you not invent a retail number?

Because the number identifies a company as well as a product. A GTIN is issued by GS1, the leading digits are the company prefix, and printing a number you do not hold produces a barcode that scans perfectly and rings up as somebody else’s product.

That is worse than a code that fails. A failing code is noticed at the till; a working code pointing at the wrong item creates stock and pricing errors that surface much later, and retailers will not accept goods carrying one.

A generator will happily encode any valid number. Whether you are entitled to use it is a separate question with a commercial answer.

How does the check digit work?

It is calculated from the digits before it, so a scanner can verify it read the number correctly. For EAN-13 the digits are weighted alternately by 1 and 3, summed, and the check digit is whatever brings the total to the next multiple of ten.

Symbology Body Check digit
EAN-13 978020137962 4
UPC-A 03600029145 2
EAN-8 9638507 4
ITF-14 1234567890123 1

This is why a mistyped retail number usually fails cleanly rather than scanning as something else — a single wrong digit almost always breaks the check. Code 128 and Code 39 have no user-visible check digit of this kind, which is one reason they are unsuitable for retail.

Why is Code 128 shorter than expected?

Because it switches encoding modes to pack data efficiently. Its numeric mode stores two digits in the space of one character, so a long run of digits takes about half the width you would predict from the character count.

That efficiency is the reason it dominates logistics. Code 39 encodes each character in a fixed and comparatively wide pattern, and a label that fits in Code 128 may not fit at all in Code 39 — which is the practical argument for the newer symbology wherever an older system does not mandate the older one.

What about the human-readable line?

The digits printed under a retail barcode are not decoration and not optional. They are the fallback when the scanner fails, and a till operator typing them in is why a smudged code does not stop a queue.

They also have a specific layout on EAN-13, where the first digit sits outside the bars to the left. That is not a design choice — the first digit is encoded in the pattern of the left-hand group rather than as bars of its own, so it has nowhere else to go.

How wide should the bars be?

The narrow bar — the X-dimension — is what determines readability, and retail codes have a defined nominal size with a permitted range around it. Printing a retail barcode smaller than its minimum is a common cause of rejection by a distributor.

Two practical rules. First, never scale a barcode non-uniformly: stretching it horizontally changes the bar widths and breaks it, while reducing the height is usually tolerated. Second, keep the light margins at each end — the equivalent of a QR code’s quiet zone — because scanners need them to find the start and stop patterns.

Print in vector form where possible. A barcode rasterised at a low resolution and then scaled produces bars of uneven width, which is invisible to the eye and fatal to a scanner.

Questions people ask

Can I make a sheet of them? Yes — generate each code and lay them out for printing. Keep the light margins between codes rather than butting them against each other.

What about QR codes for products? They coexist rather than compete. Two-dimensional codes are being adopted alongside linear ones for consumer-facing information, and the linear code remains what the till reads.

Does a barcode contain the price? No. It contains an identifier, and the price is looked up from it. This is why a shop can change a price without reprinting anything.

Can Code 39 hold lower-case letters? Not in its basic form — it covers upper-case letters, digits and a handful of symbols. Full ASCII requires an extended encoding that most readers support and not all do.

Ask who is scanning it and the symbology chooses itself. The barcode generator calculates the check digit as you type, the QR code generator covers the two-dimensional cases, and the invoice generator is what usually needs to travel with the goods.