Docuboxer
By Sergio Alonzo Piña··6 min read

EAN vs UPC vs Code128: which barcode do you need?

Which industry uses each, why EAN-13 is wrong for internal inventory, and what you actually need to sell in retail stores.

It depends on who's scanning it: for retail shelf sale in the US or Canada you need UPC-A, for retail outside North America you need EAN-13, and for anything internal — warehouse labels, inventory bins, shipment tracking — the right answer is almost always Code128. You can generate barcodes for free in any of these formats, right in your browser, with nothing uploaded anywhere.

UPC-A: the standard at every US and Canadian checkout

UPC-A is 12 digits: a company prefix, a product code, and a check digit at the end. It's the format on virtually every packaged product sold in a US or Canadian store, and it's what every point-of-sale scanner in North America is built to read first.

The digits aren't arbitrary. The company prefix portion is licensed to a specific business through GS1 US— the organization that administers barcode numbering for North America as part of the global GS1 system. That's the piece people miss: a UPC that scans correctly isn't automatically a UPC you're allowed to sell under.

EAN-13: UPC's international counterpart

EAN-13 is the 13-digit standard used almost everywhere outside North America — Europe, Latin America, most of Asia. The relationship to UPC-A is simple and worth remembering: a UPC-A is an EAN-13 with a leading zero. Internally, most modern scanners and POS systems treat both as the same 13-digit format, which is why a EAN-13 reader picks up UPC-A codes without any configuration change.

There's also EAN-8, an 8-digit shrunk-down version for packaging too small to fit a legible 13-digit code — gum packs, small tins, travel-size cosmetics. Same logic, fewer digits available for the product code.

Code128: the format for anything that isn't a checkout

Code128 is alphanumeric and variable-length, which makes it far more flexible than UPC or EAN for anything that never has to pass through a retail scanner: warehouse bin labels, lot numbers, internal SKUs, shipment and tracking numbers. Because it doesn't depend on an external registry, you can design your own numbering scheme without asking anyone's permission.

If those codes come out of an inventory export or a spreadsheet, the CSV to JSON converter is a quick way to reshape that data before batch-generating labels, and the number base converter is handy if your internal IDs are hex or another base you need to translate into a plain decimal SKU.

Code39: the legacy format that refuses to die

Code39 predates Code128 and is less dense — it needs more horizontal space to encode the same amount of data — but it's still the default in sectors running older hardware: automotive parts, some industrial and defense systems, scanners that were never upgraded. Unless you're locked into legacy compatibility, Code128 is the better choice for anything new.

What the check digit actually does

Both UPC-A and EAN-13 end in a check digit derived from the preceding digits through a weighted modulo-10 calculation. It's not product data — it's a built-in error check. If a number gets mistyped, or a scanner only catches part of a smudged or curled label, the check digit won't match and the system rejects the read instead of quietly logging the wrong item. It's the same principle behind a credit card number or an IBAN.

The part most guides skip: a valid barcode isn't a license to sell

You can generate a perfectly valid UPC-A — correct digit count, correct check digit — and still not have the right to sell a product under it. The company-prefix portion of a UPC or EAN is licensed through GS1, not invented by whoever needs a number that day. A self-assigned number, even a mathematically valid one, can collide with a real product from a real company, and most major retailers and marketplaces (Amazon included) cross-check GS1 registration before they'll list an item under a given barcode.

For internal use — shelving, stock counts, your own tracking numbers — none of that applies, since the code never leaves your system and nobody else needs to recognize it. That's exactly the case where Code128 is the right call: it doesn't borrow a retail standard it has no license to use, so there's no collision risk with anyone else's product.

Quick decision guide

  • Selling retail in the US or Canada: UPC-A, via a GS1 US company prefix.
  • Selling retail outside North America: EAN-13 (or EAN-8 for small packaging), via GS1.
  • Internal use — inventory, warehouse, tracking: Code128, no registration needed.
  • Stuck with legacy Code39 hardware: keep it for compatibility, don't pick it for anything new.

Generate a barcode now

UPC-A, EAN-13, Code128 and Code39, entirely in your browser.

Open barcode generator →

Related tools

You might also like: convert CSV to Excel without breaking your data and 13 privacy-first developer tools.