All articles

Barcodes: how Code 128 differs from EAN-13

The first product ever scanned at a retail checkout was a 10-pack of Wrigley's Juicy Fruit gum, at a Marsh supermarket in Troy, Ohio, on June 26, 1974 — the moment UPC-A stopped being a grocery-industry proposal and became the barcode that would eventually standardize retail worldwide.

UPC-A's origin and the GS1 prefix system it grew into

UPC-A was developed for US grocery retail to speed up checkout and inventory tracking, and its European extension, EAN-13, followed in 1976, adding a leading digit for international use. Today every EAN-13 code starts with a GS1 prefix that identifies which country's GS1 member organization issued the number to the company — not where the product was actually manufactured. US and Canadian companies are assigned prefixes in the 00–13 range, a leftover of UPC-A's original 12-digit numbering absorbed into the 13-digit EAN-13 standard.

Code 128: when you need letters and symbols

Unlike EAN-13, Code 128 can encode not just digits but letters and special characters from the full ASCII set. It's the format of choice in logistics and warehousing, where serial numbers or composite identifiers are more common than a plain numeric code.

Why you can't just change the format arbitrarily

Every barcode format has its own structure of start/stop symbols, bar widths, and checksum algorithm. A scanner detects the format automatically from these structural markers, which is why you can't encode arbitrary text as EAN-13 — it only accepts 12 digits plus a check digit.

Why you'd need this

  • Generate a barcode in the format required for labeling a product or inventory item.
  • Understand which format to pick depending on the data type — digits only, or arbitrary text.
  • Verify a check digit is correct before printing a label.

UPC-A and how it differs from EAN-13

UPC-A is a 12-digit format; EAN-13 is a 13-digit international extension of it. UPC-A is actually a subset of EAN-13: prepend a zero to a 12-digit UPC-A number and you get a fully valid 13-digit EAN-13 code with the same value. That's why virtually every modern retail scanner reads both without any extra configuration, decades after the two standards were built to interoperate.

Try the tool