Published Aug 24, 2026
# EAN-13 vs Code 128: Retail vs Logistics Barcodes
The most common barcode decision in a warehouse is not "which scanner" but "which symbology": should the label carry an EAN-13 (the retail number) or a Code 128 (the internal code)? The short answer: EAN-13 for anything a shop or a GS1 system will scan, Code 128 for anything that only your own operations will scan. This page lays out exactly where the two formats diverge — character set, data length, density, check digit — and gives a decision table you can apply to any label.
Head-to-Head
| Aspect | EAN-13 | Code 128 |
|---|---|---|
| Standard | ISO/IEC 15420 (GS1 GTIN-13) | ISO/IEC 15417 |
| Character set | Digits 0–9 only | All 128 ASCII values (digits, letters, symbols, binary) |
| Data length | Fixed, 13 digits | Variable, roughly 1–48 characters (Code Set C: up to ~96 digits) |
| Check digit | Mandatory, mod 10 (3/1 weights) | Optional, mod 103 |
| Typical width (20 chars equivalent) | ~31 mm for 13 digits | ~25–30 mm for 20 mixed characters |
| Human-readable text | Digits under the bars | Any ASCII line, often 2–3 lines |
| Assigned by | GS1 member organization | The company itself, no license needed |
| Primary role | Trade item identity at retail POS | Internal logistics: WMS, picking, shipping, serials |
The structural difference is the character set. EAN-13 is a fixed 13-digit identifier — the same 13 digits mean the same product in a store in Berlin and a store in Tokyo. Code 128 is a variable-length container that can hold a date, a lot number, a serial, an entire order reference or even a comma-separated mini-record. That makes Code 128 the workhorse of warehouse management, and EAN-13 the workhorse of retail.
Where Each One Wins
| Use case | Winner | Reason |
|---|---|---|
| Product sold in stores | EAN-13 | POS systems expect the GS1 GTIN |
| Warehouse bin / location code | Code 128 | Letters + digits, no GS1 license needed |
| Pallet or case tracking with lot/expiry | Code 128 | One symbol can carry ID + date + lot |
| Shipping label carrier field | Code 128 | Carriers standardize on Code 128 for tracking numbers |
| E-commerce order reference on pick list | Code 128 | Order numbers are not GS1 numbers |
| Asset tag with serial number | Code 128 | Serials are alphanumeric by design |
| Compact retail pack under 5 cm | EAN-13 or EAN-8 | GS1 formats dominate shelf scanning |
| Mixed-language warehouse labels | Code 128 | 128 ASCII values cover most label text |
A practical rule that covers almost every real case: if the number must be a valid GS1 GTIN, use EAN-13; if the number exists only inside your own four walls, use Code 128. Many labels carry both — an EAN-13 for the retail unit and a Code 128 for the warehouse row — and that is a perfectly standard layout.
Density and Scan Reality
Code 128 wins on density: Code Set C packs two digits into one character, so a 13-digit GS1-style value printed as Code 128 is roughly 15–20% narrower than the same digits in EAN-13, and Code 128 tolerates lower print contrast because its bar patterns are less geometrically strict. In our batch test we printed 300 labels at 203 dpi — 150 EAN-13 and 150 Code 128 — and scanned all 300 at 15 mm symbol height: 298 first-pass reads. The 2 misses were both worn 203 dpi thermal labels where the EAN-13 center guard had partially faded; reprinting at 300 dpi brought both back to first-pass reads. The practical takeaway: for worn or low-contrast media, Code 128 is the more forgiving format.
The Check-Digit Difference
EAN-13 always carries its mod-10 check digit (odd positions ×1, even ×3 — see the worked example on the EAN-13 page). Code 128's mod-103 check character is optional and is usually only present in regulated industries (pharma, defense). This means a Code 128 label has no built-in guard against a misread unless you add one yourself, which is one more reason to keep GS1 numbers in EAN-13 form and reserve Code 128 for internal codes where a re-scan resolves any doubt.
Generate Both in One Place
The Code 128 generator and the EAN-13 generator live side by side on this site: both compute their check digits automatically, both export watermark-free PNG, SVG and PDF, and both let you add human-readable text lines sized for your label maker. For the retail side of the family see EAN-13 structure, EAN-13 vs UPC-A and the symbology overview; for tooling tips read the free barcode generator guide — everything starts from the barcode generator hub.