ToolBoxOnline
Developer

Barcode Generator — EAN-13, UPC-A, Code 128, and When to Use Each Format

Not all barcodes are the same. EAN-13 for retail, Code 128 for shipping, UPC-A for North America — here's which format your project actually needs.

barcode generatorEAN-13UPCCode 128barcode formats

You need a barcode. You search "barcode generator," see a dozen format options, and realize you have no idea which one to pick. EAN-13? UPC-A? Code 128? Code 39? They all look like vertical lines to the untrained eye, but picking the wrong format means your barcode will not scan at the point of sale, the warehouse, or the shipping depot.

Our free barcode generator supports all major formats. Here is which one you need for your specific situation.

EAN-13: the global retail standard

If you are selling a physical product that will be scanned at retail checkout counters anywhere outside North America, you need EAN-13. It is a 13-digit number (12 data digits + 1 check digit) that uniquely identifies your product in the global GS1 system.

What you need: a GS1 company prefix (purchased from GS1 in your country). This prefix goes into the first digits of your barcode, followed by your product code, and the check digit is calculated automatically by our barcode generator.

Do not guess EAN-13 numbers. If you make up a random 13-digit number, it might conflict with a real product in the global database. Retailers scan your barcode and get someone else's product listing. Buy a proper GS1 prefix — it costs $250-750 depending on how many products you need to identify.

UPC-A: the North American equivalent

UPC-A is the 12-digit barcode used in the United States and Canada. Functionally identical to EAN-13 (EAN-13 is a superset — UPC-A barcodes scan correctly on EAN-13 systems but not always vice versa). If you are selling only in North America, UPC-A is sufficient. If you might expand globally, start with EAN-13.

Code 128: logistics, shipping, and internal tracking

Code 128 is the workhorse of logistics. Unlike EAN-13 and UPC-A (which encode only numbers), Code 128 encodes letters, numbers, and some symbols. This makes it ideal for:

  • Shipping labels: tracking numbers that include letters (e.g., "1Z999AA10123456784")
  • Inventory management: warehouse bin codes like "A12-B34-C56"
  • Asset tracking: equipment IDs that mix letters and numbers
  • Healthcare: patient wristbands, specimen labels, medication tracking

Code 128 is denser than Code 39 — it packs more data into less horizontal space. If your barcode needs to fit on a small label, Code 128 is the right choice. Our barcode generator handles Code 128 with automatic check digit calculation.

Code 39: the older, simpler alternative

Code 39 is older than Code 128 and encodes fewer characters (only uppercase A-Z, 0-9, and a handful of symbols). It takes more space per character. You still see it on government ID cards, military equipment, and automotive parts because these industries standardized on it decades ago and never migrated.

Use Code 39 only if: your industry requires it for compliance, or your scanning hardware is old enough that it only supports Code 39 (rare in 2026, but still happens in some industrial settings).

QR code vs barcode: when to use which

Barcodes are 1D — a line scanner reads them in one pass. QR codes are 2D — a camera reads them from any angle. Barcodes hold 12-50 characters; QR codes hold up to 4,000. Use a barcode when you need fast, single-direction scanning at checkout or on a conveyor belt. Use a QR code when you need to encode a URL, contact info, WiFi credentials, or more data than fits in a barcode.

Common mistake: printing a barcode too small. The minimum width for reliable scanning is about 1.5 inches for a 12-digit UPC-A. Smaller than that, and budget scanners cannot resolve the individual bars. Test your barcode with the actual scanner hardware your warehouse or retail partner uses — not just your phone.

For a comparison of barcode versus QR code technologies and when each makes sense, see our QR code scanner comparison guide.

Tools mentioned in this article

Compartir esta herramienta