This article contains affiliate links: we may earn a commission if you use them, at no extra cost to you. This does not influence our recommendations.
A barcode is not a product sheet
First misconception to undo: the barcode on your milk carton contains neither the price, nor the product name, nor its expiry date. It only contains a number. At checkout, the scanner reads that number, the software looks it up in the store’s database, and the database returns the price and label. The same product can cost differently across stores — the code stays the same.
The anatomy of an EAN-13
Look at the code closely: it breaks into precise zones, each with a role.
The quiet zones
On each side, a mandatory white margin (~3.6 mm left, ~2.3 mm right at nominal size). It’s the frame telling the scanner “the code starts here”. A label that crops this margin becomes unreadable — the most common cause of non-reading in home-made production.
The guard bars
Three marker patterns structure the code: two thin bars at the start, two in the middle separating the halves, two at the end. They let the scanner calibrate and know which way it’s reading — EAN-13 reads in both directions.
The encoded digits
Each digit is encoded by 7 modules (small black/white units). The elegant subtlety: the first digit isn’t directly in the bars — it drives the parity of the six left digits (each digit can be written in an “even” or “odd” version). The scanner deduces the first digit from the parity pattern. That’s why this digit displays slightly offset under the code.
The check digit
The 13th digit isn’t data: it’s a computed key (modulo-10 algorithm) from the other 12. If the scanner misreads a digit, the math doesn’t land on the check digit — the error is detected and the scan rejected rather than showing a wrong number. Our article on EAN-13 structure details the calculation.
What the bars don’t say
Three things the code does not contain, despite common belief:
- The country of manufacture — the prefix identifies the issuing GS1 organization (000-019 = US), not the factory;
- The price — it lives in the store’s database, not in the pattern;
- The product name — only the GTIN number is encoded; the description comes from the database.
Beyond EAN-13
The same principle — encode for reliable optical reading — branches into several families:
- Code 128 / Code 39 — logistics alphanumeric: references, parcels, serial numbers. Code 128 carries a built-in check character;
- 2D codes (QR, DataMatrix) — a capacity leap: hundreds of characters in a square, with redundancy to survive damage. See our QR code types guide.
To print your own labels — inventory, shelves, internal references — a thermal label printer like DYMO LabelWriter 550 — label printeraffiliate produces crisp codes with no ink cartridge, and our barcode generator covers the four common formats.



