Code 128 vs EAN-13 vs UPC-A: Which Barcode Do You Actually Need?
A practical breakdown of the three most common barcode formats and when to use each one.
Someone asks you for “a barcode” and it’s genuinely unclear what they mean. There are dozens of barcode symbologies in active use, but almost everyone who isn’t in logistics or retail actually needs one of three: Code 128, EAN-13, or UPC-A. Here’s how to tell which.
UPC-A: the one on groceries in North America
If you’ve ever scanned a can of soup at a US or Canadian grocery store, you’ve seen UPC-A. It’s always exactly 12 digits, and the last one is a check digit calculated from the other 11 — you never invent it yourself.
Use UPC-A when you’re selling a physical product in the US or Canada and need a GTIN-12 assigned by GS1. You don’t get to pick your own number; a real UPC comes from a registered manufacturer prefix. But for internal use, mockups, or testing a scanner, generating one is straightforward: type any 11 digits into the Barcode Generator and the 12th digit gets calculated for you.
EAN-13: UPC-A’s international sibling
EAN-13 is the same idea with one more digit — 13 total, 12 data digits plus a calculated checksum. It’s the dominant retail barcode outside North America, and technically a UPC-A code is just an EAN-13 with a leading zero, which is why most scanners read both formats without any configuration.
If your product ships internationally, or you’re in Europe, most of Asia, or basically anywhere outside the US/Canada, EAN-13 is what retailers expect. The registration process again goes through GS1 — a real, sellable barcode requires an assigned company prefix, not a number you made up.
Code 128: everything else
Code 128 doesn’t care about being exactly 12 or 13 digits. It encodes any combination of letters, numbers, spaces, and common punctuation — practically the full range of a standard keyboard. This flexibility is why it shows up on shipping labels, employee badges, inventory tags, and event tickets: anywhere you need to encode a code that isn’t a retail product number.
A Code 128 barcode reading “WH3-A102-2026” or a tracking number like “1Z999AA10123456784” works fine, no arbitrary digit-count restriction. Under the hood, Code 128 has three character subsets (A, B, C), and our generator automatically picks the numeric subset (C) when your input is all digits with an even length — it packs two digits per symbol, producing a noticeably narrower barcode than encoding the same digits as plain text.
The check digit thing, explained
Both EAN-13 and UPC-A end with a check digit that’s mathematically derived from the digits before it — not something you choose. The formula (a weighted mod-10 checksum, part of the GS1 standard) exists so a scanner can catch a misread: if the checksum doesn’t match, the scan is rejected and tried again instead of silently recording the wrong number. This is why our tool doesn’t ask you to supply the last digit — you type 11 or 12 digits and it computes the correct trailing one automatically. If you paste in a full-length code with a digit already there, we just recalculate and overwrite it, so a typo in the check digit alone won’t produce a broken barcode.
Picking a format in practice
- Selling a physical retail product in the US or Canada → UPC-A
- Selling a physical retail product anywhere else, or internationally → EAN-13
- Anything that isn’t a retail product — asset tags, internal SKUs, coupon codes, ticket numbers, alphanumeric IDs → Code 128
One thing that trips people up: a “real” UPC-A or EAN-13 that scans correctly and is sellable through a retailer are two different things. Ours generates a mathematically valid, scannable barcode from whatever digits you give it — it doesn’t check whether that number is registered to you through GS1. For an actual retail listing, you still need a licensed prefix.
Pick a format, type your text or digits, and download a print-ready SVG or a quick PNG from the Barcode Generator — no signup, and nothing leaves your browser.