UPC vs EAN vs Code128: Which Barcode Format Do You Actually Need?
Dozens of barcode formats exist for specialized industries, but the overwhelming majority of everyday needs — retail products, internal inventory, asset tags, shipping labels — are covered by three: UPC-A, EAN-13, and Code128. They're not interchangeable, and picking the wrong one is a common source of "why won't this scan at checkout" problems.
UPC-A: the 12-digit US retail standard
UPC-A is a fixed 12-digit format, and it's what you'll find on the overwhelming majority of retail products sold in the US and Canada. The first several digits identify the manufacturer (assigned by GS1, the organization that administers barcode number ranges), the next few identify the specific product, and the final digit is a checksum calculated from the others — it exists specifically to catch a mistyped or misread digit, not to encode any additional information.
EAN-13: the international equivalent
EAN-13 is UPC-A's international counterpart — 13 digits instead of 12, used across most of the world outside North America. The extra digit at the front is typically a country or region prefix. In practice, a UPC-A code can be represented as EAN-13 by adding a leading zero, which is why most point-of-sale systems and barcode scanners handle both formats interchangeably without any special configuration.
The part that actually matters: these numbers have to be registered
This is the detail that trips people up most: generating a syntactically valid UPC-A or EAN-13 barcode is trivial — any barcode generator can produce one from 12 or 13 digits. But the number itself is supposed to be assigned to you specifically through GS1, so that it doesn't collide with another company's product using the same digits. If you're planning to sell a physical product through a retailer or major marketplace, you generally need a real, registered GS1 prefix — a barcode generator handles turning that number into a scannable image, but it doesn't grant or verify ownership of the underlying number.
Code128: for everything that isn't a retail product number
Code128 works completely differently — instead of a fixed digit count tied to a registration scheme, it can encode any alphanumeric string of essentially any reasonable length. There's no GS1 registration involved, no fixed format, and no assumption that the code represents a retail product at all. This makes it the right default for internal use: warehouse bin locations, asset tags, employee badges, internal SKUs, ticket numbers — anything you're generating and consuming entirely within your own systems, where there's no external registry to coordinate with.
How to tell a UPC-A from a Code128 just by looking
You can usually tell them apart at a glance, before any scanner is involved. Four things give it away:
- Guard bars. UPC-A and EAN-13 have three pairs of thin bars — at the start, the middle, and the end — that run noticeably longer than the rest, dipping down into the row of numbers. Code128 has no middle split and no longer bars; every bar is the same height.
- How the digits are printed. On a UPC-A the first and last digits sit outside the bars, with two groups of five in between (1-5-5-1). EAN-13 has one digit outside on the left and two groups of six under the bars. Code128 prints its text as a single centered string, and that string can include letters and dashes (
BIN-A-042), which UPC and EAN never can. - Width. A UPC-A is always exactly 95 modules wide, whatever the number. That's why every product barcode on a shelf looks the same length. A Code128 grows with its content, so a 4-character asset tag and a 20-character serial number produce very different widths.
- Digit count. Exactly 12 digits under the bars points to UPC-A and exactly 13 to EAN-13. Anything else — or anything with letters — is not a retail product code.
When the printed text is missing or you need to be certain, let a scanner tell you. Most phone barcode apps show the symbology name next to the decoded value. Many handheld scanners can also be set to prefix each scan with an AIM symbology identifier: ]E0 for EAN/UPC, ]C0 for Code128, and ]C1 for GS1-128.
"EAN-128" isn't a kind of EAN — it's GS1-128
The name causes a lot of confusion. EAN-128 (also called UCC-128 or UCC/EAN-128) is the old name for what is now GS1-128. It has nothing to do with EAN-13's structure. It is Code128 with two extra rules: the barcode starts with a special FNC1 character right after the start pattern, and the data is written as Application Identifiers (AIs). Each AI is a short numeric prefix that says what the next field means:
(01)— a GTIN-14, the product number of the item or case(10)— batch or lot number(17)— expiry date as YYMMDD(00)— SSCC, the 18-digit serial number of a specific pallet or shipping unit
The parentheses are only printed for humans; they are never encoded in the bars. Printed, a GS1-128 is indistinguishable from any other Code128, and only the FNC1 at the front tells a scanner it's structured GS1 data.
So "EAN-128 or UPC?" isn't a choice between two equivalent options. They go on different things. UPC-A or EAN-13 goes on the item that crosses the checkout counter. GS1-128 goes on the carton or pallet that item ships in, and it usually contains the product's GTIN inside its (01) field, alongside the lot and expiry data a warehouse needs. A retailer that asks for "UCC-128 labels" is talking about your shipping cartons, not your product packaging.
Which formats are similar to Code128?
If you're searching for alternatives, they fall into two families. The first family is the variable-length "internal" symbologies, which Code128 belongs to:
- Code 39 — the older predecessor, still common in automotive, defense, and government labeling. It encodes uppercase letters, digits, and a handful of symbols (
- . $ / + %and space). It needs no check character, but it's much wider than Code128 for the same data. - Code 93 — a denser successor to Code 39 with built-in check characters. It's seen less often, but most scanners read it.
- GS1-128 — covered above: Code128 with FNC1 and Application Identifiers.
- ITF-14 — 14 digits only, used on outer shipping cases, often printed inside a thick bearer-bar frame.
Code128 is usually the best of the first family because it has three internal character sets. Set C packs two digits into each symbol, so a long all-numeric code comes out far more compact than it would in Code 39.
The second family is UPC-A's own siblings, not Code128's. UPC-E is a zero-suppressed 8-digit form for small packages, and EAN-8 is the short international equivalent. Both are fixed-length retail formats that stay inside the GS1 numbering system.
UPC or Code128 for a small shop's inventory?
This is where most small retailers get stuck, and the answer depends on where each item came from:
- Products you bought from a supplier already carry the manufacturer's UPC or EAN. Scan and use that. Don't relabel it, because your POS, your supplier's invoices, and any marketplace listing all key off that number.
- Items you make or pack yourself and sell only in your own store (baked goods, repacked bulk items, consignment pieces) don't need a purchased GS1 prefix. The GS1 system reserves number ranges for exactly this: UPC-A numbers starting with
2(and4) are set aside for local, in-store use, and EAN-13 prefixes20–29are "restricted circulation" numbers whose exact use is set by each country's GS1 office. They scan at your own till like any product code, but they mean nothing outside your store. - Shelf labels, bin locations, back-room stock counts, and internal SKUs with letters are Code128 territory. There's no registry and no fixed length.
One practical check before printing a few hundred Code128 labels for the sales floor: most POS scanners can read Code128, but the POS software also has to accept that value as an item lookup, and some setups only match UPC/EAN-length numbers. Print one label, scan it at the register, and confirm it pulls up the item. If anything will leave your store — wholesale, Amazon, another retailer — it needs a real GS1-assigned number, not an in-store one.
A quick way to decide
If the code is a real retail product number assigned through GS1, use UPC-A (US/Canada) or EAN-13 (elsewhere) to match the number's actual format. If you're numbering something internal — inventory, assets, tickets — and there's no registration authority involved, Code128 is almost always the simpler, more flexible choice, since it isn't constrained to digits-only or a fixed length.
Generate them
FreeToolDev's bulk barcode generator makes up to 100 UPC-A, EAN-13, or Code128 barcodes at a time from a pasted list, and downloads them as a ZIP. UPC-A and EAN-13 codes are validated against their check digit before rendering, so a mistyped digit gets flagged — with the digit it should have been — rather than silently producing a barcode that fails to scan. If your list is missing check digits (12-digit EANs straight out of a spreadsheet), switch the check-digit option to calculate them. It doesn't produce GS1-128. Its Code128 output has no FNC1, so use GS1-aware label software for carton labels.