Last updated:
The Evolution of Barcodes and Information Density - A History of Data Compression Starting from 13 Digits
At 8:01 AM on June 26, 1974, at Marsh Supermarket in Troy, Ohio, a 10-pack (50 sticks) of Wrigley's Juicy Fruit gum was scanned at the checkout. The price was 67 cents. It is recorded as the first product read by a UPC barcode at a retail checkout. Those black-and-white stripes stored just 12 digits. Half a century later, barcodes have evolved from one-dimensional stripes to two-dimensional matrices and digital links containing URLs, with storage capacity expanding thousands of times over.
UPC and JAN - The Difference Between 12 and 13 Digits
The first standard to spread widely for retail product identification was UPC (Universal Product Code), selected in April 1973 as the standard of a US grocery industry trade association. Industrial and railway barcodes were already in practical use before then, but UPC was the starting point for a standard that unified even the digit structure around scanning products at the checkout. UPC-A consists of 12 digits: the first digit is the system number (product type), the next 5 are the manufacturer code, the following 5 are the product code, and the last digit is the check digit.
Europe and Japan adopted EAN (European Article Number) / JAN (Japanese Article Number), an extension of UPC. EAN-13 / JAN-13 uses 13 digits, with the first 2-3 digits as the country code (Japan is 45 or 49), followed by manufacturer code, product code, and check digit.
| Standard | Digits | Structure | Primary Region |
|---|---|---|---|
| UPC-A | 12 digits | 1 + 5 + 5 + 1 | USA, Canada |
| UPC-E | 8 digits | Shortened UPC-A | Small products |
| EAN-13 / JAN-13 | 13 digits | 2-3 + 4-5 + 4-5 + 1 | Europe, Japan, worldwide |
| EAN-8 / JAN-8 | 8 digits | Shortened EAN-13 | Small products |
| ISBN-13 | 13 digits | 978/979 + publisher + title + 1 | Books (worldwide) |
The check digit is calculated using the Modulus 10 algorithm. The sum of odd-position digits plus the sum of even-position digits multiplied by 3, divided by 10, subtracted from 10 gives the check digit. Which positions get tripled swaps with the total number of digits: in the 13-digit EAN-13 / JAN-13 the even-numbered positions are tripled, while in the 12-digit UPC-A it is the odd-numbered ones, so the two formats must never be mixed up.
Let's calculate with a concrete example. Suppose the first 12 digits of a JAN-13 code are "490123456789." The odd-numbered positions (1st, 3rd, 5th, 7th, 9th, 11th) add up to 4 + 0 + 2 + 4 + 6 + 8 = 24, and the even-numbered positions (2nd, 4th, 6th, 8th, 10th, 12th) add up to 9 + 1 + 3 + 5 + 7 + 9 = 34. That gives 24 + 34 x 3 = 24 + 102 = 126, and 126 divided by 10 leaves a remainder of 6, so 10 - 6 = 4. The check digit is therefore "4," and the full 13-digit code reads "4901234567894." Misread a single digit and the calculation no longer balances, which is how a scanner can reject a bad read on the spot.
The check digit is a single digit (0-9), yet it can detect 100% of simple single-digit errors and a high percentage of adjacent digit transposition errors. The power of mathematics allows a single added character to verify the integrity of 12 digits of data.
1D Barcode Evolution - From Numbers to ASCII
UPC/EAN can only store numbers, but logistics and manufacturing needed letters and symbols. To meet this demand, 1D barcode standards supporting more character types emerged successively. Code 39, devised in 1974 by David Allais and colleagues at Intermec, was one of the earliest to handle uppercase letters alongside digits, and its adoption by the US Department of Defense in 1981 established it across military and manufacturing sites.
| Standard | Origin / Lineage | Supported Characters | Character Count | Primary Use |
|---|---|---|---|---|
| Code 39 | 1974 | Uppercase + digits + 7 symbols | 43 characters | Auto parts, military |
| Interleaved 2 of 5 | Same designers as Code 39 | Digits only | 10 characters | Logistics, cardboard |
| Code 128 | 1981 | All 128 ASCII characters | 128 characters | Logistics, medical |
| GS1-128 | Derived from Code 128 | All 128 ASCII + AI | 128 characters + identifiers | Logistics, food traceability |
| Codabar | 1972 | Digits + 6 symbols | 16 characters | Libraries, blood banks |
Code 128, introduced in 1981, could store all 128 ASCII characters (uppercase, lowercase, digits, symbols, control characters). This enabled barcodes to represent complex strings like URLs and email addresses. However, the fundamental limitation of 1D barcodes remained: information is encoded only in the width and spacing of horizontal bars, imposing a physical upper limit on data capacity.
GS1-128 (formerly EAN-128) added "Application Identifiers" (AI) to Code 128. AIs are 2-4 digit numbers defining the meaning of subsequent data. For example, AI "01" means GTIN (product code), AI "17" means expiration date, AI "10" means lot number. This enables a single barcode to store product code, expiration date, lot number, and more. It's essential technology for food traceability and pharmaceutical tracking.
The physical limit of 1D barcodes is determined by minimum bar width (module width) and scanner resolution. Typical laser scanners have about 0.25 mm resolution, and Code 128's minimum module width is 0.25 mm. With a 10 cm total barcode width, about 400 modules can be placed. Code 128 spends 11 modules per character, and the start code, check character, and stop code alone consume roughly 35 modules, so what actually fits is about 30 characters. Increasing physical size increases character count, but product packaging has size limits.
The Emergence of 2D Barcodes - Carrying Information in Area
To break through 1D barcode capacity limits, 2D barcode development began in the late 1980s. By carrying information in both horizontal and vertical directions, dramatically more data can be stored in the same area.
PDF417, introduced in 1991, pioneered 2D barcodes. "PDF" stands for "Portable Data File," storing up to 1,850 alphanumeric characters. It's widely used on US driver's license backs and airline boarding passes. PDF417 is technically "stacked" - vertically stacked 1D barcodes. While different from true 2D (matrix) barcodes, it achieved tens of times the data capacity of 1D barcodes.
In 1994, Denso Wave released the QR code. As detailed in how many characters fit in a QR code, QR codes can store up to 7,089 numeric digits or 4,296 alphanumeric characters - about 2.3 times PDF417's capacity.
Data Matrix, devised by International Data Matrix, Inc., specializes in ultra-small printing. It stores up to 2,335 alphanumeric characters and is widely used for electronic component marking and pharmaceutical identification. The US Electronic Industries Alliance (EIA) also recommends Data Matrix for labeling small electronic components.
Aztec Code, devised in 1995 and published as an AIM standard in 1997, features a central finder pattern (bullseye). It stores up to 3,067 alphanumeric characters and is used for European rail tickets and airline boarding passes. Unlike QR codes, it requires no surrounding quiet zone, making it easier to print in limited spaces.
| Standard | Type | Max Capacity (Numeric) | Max Capacity (Alphanumeric) | Error Correction |
|---|---|---|---|---|
| UPC-A | 1D | 12 digits | - | 1 check digit |
| Code 128 | 1D | Variable (size-dependent) | Variable | 1 check character |
| PDF417 | 2D (stacked) | 2,710 digits | 1,850 characters | Up to ~50% |
| QR Code | 2D (matrix) | 7,089 digits | 4,296 characters | Up to ~30% |
| Data Matrix | 2D (matrix) | 3,116 digits | 2,335 characters | Up to ~30% |
| Micro QR | 2D (matrix) | 35 digits | 21 characters | Up to ~25% |
Information Density Comparison - How Many Characters Per Square Centimeter?
Comparing barcode evolution by "information density" (characters stored per unit area) makes technological progress immediately apparent.
A standard UPC-A barcode measures about 3.73 cm x 2.59 cm (area ~9.66 cm²), storing 12 digits. Information density is about 1.2 digits/cm². A QR code version 10 (57 x 57 cells) printed at 3 cm x 3 cm (9 cm²) with error correction level L stores up to 652 digits. Information density is about 72 digits/cm² - roughly 60 times UPC-A.
| Standard | Typical Size | Stored Data | Info Density (digits/cm²) | vs UPC-A |
|---|---|---|---|---|
| UPC-A | 3.73 x 2.59 cm | 12 digits | ~1.2 | 1x |
| Code 128 (20 chars) | 4.0 x 1.0 cm | 20 characters | ~5.0 | ~4x |
| QR Code (Ver.10, L) | 3.0 x 3.0 cm | 652 digits | ~72 | ~60x |
Data Matrix specializes in ultra-small printing for electronic components and pharmaceuticals. ECC 200 lets you step the symbol size from 10 x 10 cells up to 144 x 144 cells, so the area can be kept to the minimum the intended character count requires, and a mark of a few millimetres square still fits. The encoding concepts explained in character count vs. byte count directly relate to barcode data storage methods.
ISBN - A 13-Digit Universal Code for Identifying Books
ISBN (International Standard Book Number) is a 13-digit code for uniquely identifying books. Extended from 10 to 13 digits in 2007, it became compatible with EAN-13. The first 3 digits are "978" or "979" (book prefix), followed by country/region code, publisher code, title code, and check digit.
Japanese ISBNs follow the format "978-4-XXXX-XXXX-X," where "4" is Japan's country code. Publisher code length varies by publisher size: major publishers get 2 digits (e.g., 06 = Kodansha), while smaller publishers get 4-5 digits. Shorter publisher codes allow more digits for title codes, enabling more book registrations.
The 13-digit count provides sufficient combinations to uniquely identify every book worldwide. Theoretically 10^13 = 10 trillion combinations, though structural constraints limit actual usable numbers. Still, that leaves capacity with orders of magnitude of headroom over the body of books published worldwide to date.
GS1 Digital Link - The Next-Generation Barcode Standard
GS1 Digital Link fundamentally changes the barcode concept. It expresses product identification codes (GTIN) as URLs, stored in QR codes.
The traditional JAN code "4901234567894" becomes "https://id.gs1.org/01/04901234567894" in GS1 Digital Link. Scanned by a POS scanner, it functions as a traditional product code; scanned by a smartphone, it navigates to the manufacturer's product page. One QR code serves both POS systems and consumers.
As explained in URL character limits, URLs have browser and server length limits, but GS1 Digital Link URLs typically fit within 50-100 characters, easily stored in QR code versions 3-5.
50 Years of Barcodes - From 12 Digits to 7,089
Against the 12 digits of the UPC-A that went into service at the checkout in 1974, the QR code that arrived in 1994 holds up to 7,089 digits, which works out to roughly 590 times the capacity in a single code. However, most barcodes in actual use utilize only a fraction of their capacity.
JAN codes on convenience store products are 13 digits. QR payment codes are typically 50-200 character URLs. Airline boarding passes are about 100-200 characters. Despite technical capacity for thousands of characters, practical use requires only tens to hundreds.
This "capacity headroom" isn't wasted. QR code error correction allocates part of data capacity to redundancy. A version 10 QR code with error correction level H stores about half the data of level L, but can recover original data even with 30% damage. This redundancy is why design QR codes (with logos in the center) work.
Micro QR codes are a space-saving version of standard QR codes. With only one finder pattern (standard QR codes have three), they store up to 35 digits. They're specialized for ultra-small spaces like circuit board markings. "rMQR codes" (rectangular Micro QR codes) were later added to the family, so narrow strips of space can be printed on too.
This shows that barcodes' essence isn't "storing massive data" but "serving as the minimal key connecting physical and digital worlds." A 13-digit JAN code is a pointer to vast product information in a database. A QR code URL is a link to infinite information on the web. Barcodes need only enough characters to uniquely identify a reference - they don't need to store all the information themselves.
The history of barcodes, starting from one pack of gum that passed through a checkout, embodies the essence of information design: "accessing maximum information with minimum characters."