Online Tools Toolshu.com Log In Sign Up

Which Barcode Format Should You Use?: EAN-13, Code 128, UPC, and More Compared

Original Author:bhnw Released on 2026-04-16 16:34 4 views Star (0)

The Barcode on Grocery Items Is Different From the One on Your Shipping Label

Pick up any supermarket product — there's a row of black and white lines on the back with 13 digits underneath. That's EAN-13. Now look at a shipping label: the barcode is longer and denser, and it encodes letters too. That's Code 128.

Both are called "barcodes," but they follow completely different formats. Pick the wrong one and the scanner won't read it. Understand the differences and you'll always choose the right type for the job.


How Barcodes Work

A barcode (1D barcode) encodes data in the combination of wide and narrow bars (dark) and spaces (light). A laser scanner emits a red beam that hits the barcode; dark bars absorb the light while light spaces reflect it. The sensor reads the reflected pattern and decodes the width sequence into data.

Different barcode standards define different rules for which combination of bars represents which character — that's why so many formats exist. Each one is an encoding scheme optimized for a particular use case.

Barcode vs QR code: A barcode encodes information only horizontally — it's one-dimensional. A QR code encodes in both horizontal and vertical directions, fitting far more data into the same space. If you need to store a URL, long text, or multilingual content, use a QR code (see the QR Code Generator). For short numeric or alphanumeric codes like retail product numbers or warehouse location IDs, a barcode is the right choice.


Common Barcode Formats at a Glance

EAN-13: The Global Retail Standard

Almost every product in a supermarket carries an EAN-13 (European Article Number) barcode.

  • Fixed length: 13 numeric digits; the last digit is a check digit computed from the first 12
  • Country prefix: The first 2-3 digits identify the registration country (e.g., 690-699 for mainland China)
  • Globally accepted: Any country's POS system can scan and read it
Example: 6 901234 567892
         ↑    ↑       ↑
    Country  Company  Product + Check digit

Use cases: Retail products, supermarket checkout, inventory management. If you're registering a barcode for your own brand, you need a manufacturer identification code from GS1.


EAN-8: The Compact Version for Small Packaging

EAN-8 is a shortened EAN-13 — 8 digits — designed for products whose packaging is too small to fit a 13-digit code.

  • Fixed length: 8 numeric digits
  • Smaller footprint: Ideal for chewing gum, small condiment bottles, and similar compact packaging
  • Globally accepted like EAN-13

UPC-A: North American Retail's Standard

UPC-A (Universal Product Code) is the dominant retail barcode format in the US and Canada, using 12 numeric digits.

EAN-13: 6 901234 567892  (13 digits, with country code)
UPC-A :   01234 567890   (12 digits, US/Canada products)

EAN-13 is actually backward-compatible with UPC-A — prepend a 0 to UPC-A and you have EAN-13. Modern retail scanners handle both formats simultaneously. Use UPC-A if your product is primarily for North American retail; use EAN-13 for everywhere else.


Code 128: The Most Versatile Industrial Format

Code 128 is the most widely used barcode in industrial and logistics settings. It supports the full ASCII character set — letters, numbers, and special symbols.

  • Variable length: No restriction on content length
  • High density: Encodes roughly twice as much data as Code 39 in the same space
  • Three subsets: A (control characters + uppercase), B (full printable ASCII), C (double-digit high density)

Use cases: Courier tracking numbers, warehouse location codes, production batch numbers, library catalog numbers. Virtually every courier company uses Code 128 on its shipping labels.


Code 39: The Industrial and Military Legacy Standard

Code 39 is one of the earliest alphanumeric barcodes, introduced in 1974. It supports uppercase letters, digits, and six special characters: -. $/+%.

  • Self-checking: No mandatory check digit (though one can be added optionally)
  • Lower density: Requires more space than Code 128 for the same content
  • Widely standardized: US military specifications, automotive industry, medical device labels

Many modern applications have switched to Code 128, but Code 39 remains in heavy use in automotive parts and military supply chains due to industry inertia and legacy compliance requirements.


ITF (Interleaved 2 of 5): The Shipping Carton Choice

ITF (Interleaved 2 of 5) is a numeric-only format that requires an even number of digits — most commonly 14 digits in the GTIN-14 format.

  • Numeric only, even digit count required
  • Bold stripes: Readable even on rough corrugated cardboard with inconsistent print quality
  • Higher density than Code 39

Use cases: Outer shipping cartons, pallet labels, warehouse box codes (as distinct from the EAN-13 unit codes on individual items).


Codabar: Healthcare and Libraries

Codabar dates back to 1972 and supports digits plus -.:$/+. Its distinguishing feature: start and stop characters must be one of A, B, C, or D.

Use cases: Blood bank labels (US healthcare standard), library circulation systems, early FedEx labels. Modern systems have largely replaced it with Code 128, though healthcare facilities often retain it for regulatory compliance.


Format Selection Decision Tree

Need to encode letters?
├── Yes → Long content or full ASCII needed?
│          ├── Yes → Code 128
│          └── No  → Code 39 (legacy compatibility) or Code 128
└── No (numeric only) → For retail products?
                    ├── Yes → International: EAN-13 / Small pack: EAN-8
                    │         North America: UPC-A
                    └── No  → Outer carton or pallet?
                               ├── Yes → ITF-14
                               └── No  → Code 128 (universal fallback)

Printing Barcodes: What to Watch For

Minimum size: The standard EAN-13 size is approximately 37.29mm × 26.26mm, with a scaling range of 80% to 200%. Printing too small causes scan failures.

Quiet zone: Barcode formats require blank margins on both sides — EAN-13 needs about 3.63mm on each side. Without this, the scanner can't locate the barcode boundary.

Contrast: Black on white gives maximum contrast. Avoid colored barcodes unless your scanner specifically supports them. When printing on tinted packaging, verify the contrast between the barcode and background is sufficient.

Print resolution: 300dpi minimum; 600dpi or above is recommended for dense formats like high-capacity Code 128.

To quickly generate a barcode for testing, the Online Barcode Generator lets you select the format, enter the content, and download a PNG — no setup required.

发现周边 发现周边
Comment area

Loading...