A linear barcode, a QR code, and a Data Matrix on a red, cream, and charcoal background.

The Global Trade Item Number (GTIN) is the identifier encoded in most barcodes found on consumer products. When a cashier scans a bottle of shampoo at a supermarket, the checkout system reads its GTIN and uses it to retrieve information about the product, including its price.

The system works remarkably well considering its age. The Universal Product Code (UPC) was introduced in 1973, and the European Article Number (EAN) followed in 1977. Both were developed at a time when computing resources were expensive, telecommunications infrastructure was limited, and barcodes had to be readable by relatively simple optical scanners.

Many of the constraints that informed those decisions no longer apply. However, the structure of the identifiers has remained largely unchanged, as successive revisions to the standard have had to preserve compatibility with existing systems.

How would we design a global product identification standard if we were starting from scratch today?

I propose a fixed-length, 16-digit numeric identifier, allocated from a common global numbering space and primarily encoded using Data Matrix barcodes. Such a standard would simplify the allocation and management of product identifiers while preserving two important characteristics of GTIN: the ability to print identifiers on small packages and the possibility of entering them manually when automatic scanning fails.

How GTINs are allocated

GS1 is the international organisation that maintains the GTIN standard and administers the numbering system through its member organisations.

Consider the following hypothetical GTIN-13:

7891234567895

The number could have been constructed as follows:

Component Digits Function
GS1 prefix 789 Identifies the issuing GS1 member organisation
Company-specific portion 1234 Completes the licensed GS1 Company Prefix
Item reference 56789 Distinguishes products within the licensed numbering block
Check digit 5 Detects certain errors in the preceding digits

GS1 Global distributes numbering capacity among its member organisations, which subsequently license portions of that capacity to companies. A company that receives a GS1 Company Prefix can then assign identifiers to its products within the corresponding numbering block.

The length of the company-specific portion varies according to the amount of numbering capacity licensed to the company. Within a three-digit GS1 prefix, for example, the following allocations are mathematically possible:

Company-specific digits Item reference digits Maximum GTINs per company
3 6 1,000,000
4 5 100,000
5 4 10,000
6 3 1,000
7 2 100
8 1 10

This arrangement allows manufacturers to assign GTINs independently once they have obtained a licence. However, it also means that GS1 must allocate numbering capacity in advance, without knowing exactly how much of that capacity each company will eventually use.

Suppose a company receives a prefix that allows it to identify 10,000 products but only ever introduces 300. The remaining 9,700 numbering positions cannot be independently assigned to other companies while the original licence remains in effect.

Some GS1 member organisations license individual GTINs, so companies that only need a few numbers can obtain them without reserving a block. GS1 US, for example, offers both options.

Advance allocation can create the same problem at the international level, where one GS1 member organisation may have substantial unused numbering capacity while another requires additional allocations.

Variable-length prefixes alleviate this problem by allowing GS1 to distribute capacity in blocks of different sizes. However, they introduce another complication: the boundaries between the components of a GTIN cannot generally be determined from the number itself.

The hypothetical GTIN presented earlier could correspond to any of the following structures:

789 1234     56789 5
789 12345     6789 5
789 123456     789 5
789 1234567     89 5
789 12345678     9 5

Because all five interpretations produce the same number and the same check digit, a system would need to know which company prefix GS1 actually licensed.

As GS1 itself explains, the complete GTIN has no intrinsic meaning that can be established without consulting a database. Even the issuing GS1 organisation cannot be used to determine where a product was manufactured.

Given that product information already needs to be stored separately, I would question whether administrative allocation boundaries need to be incorporated into the identifier at all.

A single global numbering space

Under the proposed standard, every product identifier would consist of exactly 16 decimal digits:

  • The first 15 digits would constitute the product identifier.
  • The final digit would be a check digit calculated from the preceding 15 digits.

Consider the following hypothetical identifier:

583719264058731 5
└──────┬──────┘ │
       │        └─ Check digit
       └────────── Product identifier

The first 15 digits would have no predetermined internal structure. No portion of the number would be reserved for a country, company, product category or issuing organisation.

Instead, the organisations responsible for administering the standard would allocate identifiers from a shared numbering space and record the corresponding product information in a registry.

The registry could be operated by a single international organisation or by several organisations working under a common allocation protocol. In either case, the system would need to ensure that an identifier assigned by one organisation could not subsequently be assigned by another.

Manufacturers could request identifiers programmatically through an API. Companies introducing large numbers of products could submit requests in batches, without having to license permanent numbering blocks based on their anticipated product portfolios.

The registry would associate each identifier with information about the corresponding trade item, such as its brand, description, quantity, packaging configuration and responsible organisation.

GS1 already gives retailers and marketplaces access to company and product information through Verified by GS1. Existing GTINs can also survive an acquisition if the acquiring company maintains the relevant licence. Under the proposed system, the registry would record responsibility for each product directly, so a company acquiring a single brand could take responsibility for its identifiers independently of the numbering blocks originally used to assign them.

The distinction between a product identifier and a product’s attributes would also simplify the underlying data model. An application would not need to determine the length of a company prefix before establishing which organisation was responsible for a particular product.

Why use 16 numeric digits?

A natural alternative would be to use a Universally Unique Identifier (UUID). A UUID provides an enormously larger numbering space than GTIN and, depending on the version used, allows identifiers to be generated independently with a negligible probability of collision.

However, product identifiers have requirements that do not apply to most identifiers used in software development.

If a cashier cannot scan a product’s barcode, the cashier must be able to enter its identifier manually. The identifier must therefore be short enough to read and transcribe quickly, including when printed in small type on product packaging.

Entering a UUID in its standard representation would mean typing 36 characters. Even a more compact encoding would require considerably more characters than GTIN.

A 16-digit numeric identifier represents a compromise between numbering capacity and ease of manual entry. It would provide a much larger numbering space while remaining suitable for entry using an ordinary numeric keypad.

With one digit reserved for error detection, the proposed standard would have 10¹⁵ possible identifiers, or one quadrillion.

Total digits Assignable digits Theoretical numbering capacity
8 7 10 million
12 11 100 billion
13 12 1 trillion
14 13 10 trillion
15 14 100 trillion
16 15 1 quadrillion
17 16 10 quadrillion
18 17 100 quadrillion

The proposed numbering space would be a thousand times larger than the theoretical capacity of GTIN-13. In practice, the difference in usable capacity would also depend on which ranges were reserved and how identifiers were allocated.

For instance, suppose that 120 million new product identifiers were issued every year. At that constant rate, a numbering space of one quadrillion identifiers would take approximately 8.3 million years to exhaust.

At the same rate, a flat 14-digit scheme with one check digit would last about 83,000 years. Since both lengths fit in a 14 × 14 Data Matrix, I would start with 16 digits to use the full numeric capacity of that symbol without increasing the size of the barcode. Fourteen digits would save two keystrokes and fit existing 14-digit data fields. With 16 digits, systems that accept both formats could distinguish the new numbers from GTINs by length. If transcription tests show that the extra digits make a material difference at checkout, 14 would provide ample capacity.

Retailers can already use Data Matrix barcodes with existing GTINs. In the comparison below, the proposed encoding saves 1.25 mm per side on a square barcode that carries only the identifier. The main reason to adopt a new format would be to allocate numbers on demand from a shared global pool and let the registry record transfers of responsibility for individual products independently of the original prefix licence. Those benefits would have to justify the cost of updating systems built around GTIN.

Identifiers would never be reassigned to different products, including after the original products were discontinued. GS1 has already generally prohibited the reuse of GTINs since 2019, recognising that information about products remains in commercial databases long after those products have ceased to be manufactured.

Calculating and validating the check digit

The proposed standard could retain the modulo-10 check digit algorithm already used by GTIN.

Starting with the rightmost digit of the 15-digit identifier, we multiply its digits alternately by three and one. We then add the resulting values and determine the smallest number that must be added to obtain a multiple of ten.

The following Python implementation illustrates the algorithm:

import re


def check_digit(payload: str) -> str:
    if not re.fullmatch(r"[0-9]{15}", payload):
        raise ValueError("Expected exactly 15 ASCII digits")

    total = sum(
        int(digit) * (3 if i % 2 == 0 else 1)
        for i, digit in enumerate(reversed(payload))
    )

    return str((-total) % 10)


def is_valid(identifier: str) -> bool:
    return (
        bool(re.fullmatch(r"[0-9]{16}", identifier))
        and identifier[-1] == check_digit(identifier[:-1])
    )


payload = "583719264058731"
identifier = payload + check_digit(payload)

print(identifier)
# 5837192640587315

print(is_valid(identifier))
# True

print(is_valid("5837192640587314"))
# False

The identifiers should be represented as strings in software systems, even though they consist exclusively of digits. Otherwise, an application might inadvertently remove leading zeros when converting an identifier to a number.

The check digit allows applications to detect all single-digit substitution errors and many other transcription errors without consulting the product registry. Determining whether an identifier has actually been allocated to a product, however, would require a separate registry lookup.

Encoding the identifier in a barcode

One of the advantages of developing a product identification standard today is that we no longer need to rely primarily on linear barcodes.

The same 16-digit identifier can be encoded using several existing barcode symbologies.

Code 128, QR Code and Data Matrix symbols encoding the same 16-digit product identifier.
Three different barcode formats encoding the identifier 5837192640587315. The symbols are enlarged independently to show their respective structures.

A Code 128 barcode using Code Set C can encode the identifier efficiently by representing pairs of decimal digits. However, the resulting barcode is relatively wide.

A QR Code can encode the same identifier in a considerably smaller area than Code 128, while also providing error correction.

Data Matrix is particularly well suited to a numeric identifier because its encoding scheme can represent two consecutive decimal digits in a single data codeword. Consequently, the complete 16-digit identifier can be accommodated within a Data Matrix ECC 200 symbol consisting of just 14 rows and 14 columns.

The symbol must also be surrounded by a blank margin, known as the quiet zone, whose width is equivalent to at least one module on each side. The complete footprint would therefore consist of 16 × 16 modules.

Two Data Matrix symbols with identically sized modules. The proposed symbol has 14 rows and columns. The GS1 symbol has 16. Outlines mark their one-module quiet zones.
Data Matrix encoding the proposed 16-digit identifier. At the nominal dimensions of the standard, the complete symbol, including its quiet zone, would occupy 10 × 10 mm. The GS1 DataMatrix alongside it encodes GTIN 07891234567895 under application identifier 01 and occupies 11.25 × 11.25 mm at the same module size of 0.625 mm.

I would specify a nominal physical size of 10 × 10 mm for general retail applications. This would produce modules measuring 0.625 mm per side.

The choice of module size is important because a barcode that can theoretically be printed within a very small area may be difficult to read consistently under ordinary retail conditions.

For comparison, GS1’s guidelines for 2D barcodes at retail points of sale specify a minimum module size of 0.396 mm, a target of 0.495 mm and a maximum of 0.990 mm for products scanned at general retail points of sale but not in general distribution.

The proposed module size of 0.625 mm would fall comfortably within that range. It would also correspond almost exactly to five printer dots on a 203 DPI thermal printer, which is a common resolution for inexpensive label printers.

These comparisons suggest that a nominal size of 10 × 10 mm is a reasonable starting point. Establishing the actual minimum size and manufacturing tolerances would nevertheless require empirical testing with different printers, scanners and packaging materials.

The proposed barcode would encode the 16 digits directly as ordinary Data Matrix data, using eight codewords. A GS1 DataMatrix carrying only a GTIN uses those eight codewords for the two-digit application identifier 01 and a 14-digit GTIN field. It requires a ninth codeword, called FNC1, to tell the scanner to interpret the data as a GS1 element string. That extra codeword moves the smallest square symbol from 14 × 14 to 16 × 16 modules. At 0.625 mm per module, the difference is 1.25 mm on each side.

These dimensions apply to barcodes that carry only the product identifier. If a supermarket also wanted to read expiry dates or batch numbers at checkout, as it can with GS1 DataMatrix today, those fields would require a larger symbol with a syntax for identifying each field or a separate barcode.

Making the identifier readable by humans

Even if Data Matrix became the principal barcode format used in retail, the complete identifier should remain visible on the product packaging.

Printing all 16 digits on a single line would undermine some of the space savings achieved by adopting a square barcode. One way to overcome this problem would be to distribute the digits around the four sides of the symbol.

Each side would contain four digits. A small marker would identify the beginning of the number, which could then be read clockwise.

Alternatively, the digits could be distributed across two lines, with eight digits above the symbol and eight below it. This arrangement would allow the entire number to be read without rotating the package.

Both layouts would preserve the quiet zone surrounding the Data Matrix.

Three barcode labels at the same relative scale: a square label with four digits on each side, a square barcode with two lines of eight digits, and a narrow rectangular barcode with all sixteen digits alongside it.
Alternative arrangements of the human-readable identifier. All three barcodes encode the same number, while their dimensions and text placement accommodate different packaging requirements.

With two millimetres reserved for text on each relevant side, the complete square label could occupy approximately 14 × 14 mm. The two-sided arrangement could occupy approximately 10 × 14 mm.

The four-sided arrangement would allow manufacturers to use relatively large digits while maintaining a square footprint. However, the two-sided arrangement would be easier to read and transcribe, particularly when a cashier needs to enter the identifier manually.

I would therefore permit both arrangements, with the two-sided version as the default for general retail.

The appropriate minimum character size, spacing and reading conventions would need to be established through legibility and transcription tests.

Exceptionally small products and curved packaging

A standard that requires every product to accommodate a square barcode of exactly the same dimensions would encounter difficulties with certain types of packaging.

Consider a pencil, a lipstick tube or a small pharmaceutical ampoule. Even if there is sufficient surface area to print a square barcode, the curvature of the packaging may prevent a scanner from capturing the entire symbol.

A Data Matrix printed on a cylindrical surface becomes progressively distorted towards its edges. The narrower the cylinder and the wider the barcode, the greater the distortion.

Fortunately, Data Matrix ECC 200 supports rectangular symbols in addition to square ones. The proposed 16-digit identifier fits into a rectangular symbol consisting of eight rows and 32 columns.

A rectangular Data Matrix symbol consisting of eight rows and thirty-two columns, encoding the same sixteen-digit identifier as the square symbol.
Rectangular Data Matrix measuring 17 × 5 mm, including its quiet zone, at a module size of 0.5 mm.

To reduce distortion, a manufacturer could orient the rectangular symbol with its longer dimension along the cylinder’s axis, so that only its narrower dimension would wrap around the curved surface.

The difference can be substantial. Consider a cylindrical container with a diameter of 10 mm. The active portion of our standard square barcode would measure 8.75 mm across. If printed on the curved surface, each edge of the barcode would deviate from the central tangent plane by approximately 50 degrees.

By comparison, a rectangular barcode with a module width of 0.5 mm would have an active width of just 4 mm when oriented longitudinally, so each edge would deviate by approximately 23 degrees. At that shallower angle, a scanner aimed at the centre of the symbol would have a more direct view of its edges.

The standard could consequently define several packaging profiles:

Profile Matrix dimensions Module width Footprint including quiet zone Intended application
S10 14 × 14 0.625 mm 10 × 10 mm General retail
S8 14 × 14 0.500 mm 8 × 8 mm Small packages
S6 14 × 14 0.400 mm 6.4 × 6.4 mm Exceptionally small flat surfaces
R17 8 × 32 0.500 mm 17 × 5 mm Narrow or curved packages
R14 8 × 32 0.400 mm 13.6 × 4 mm Exceptionally narrow packages

Since the dimensions in the table exclude the human-readable identifier, manufacturers would need to reserve additional space for the digits, depending on the chosen layout.

Products with exceptionally irregular surfaces could carry their identifiers on attached labels, tags or external packaging. Jewellery, for instance, would not need to have a barcode printed directly on the item itself.

Since all these profiles would encode the same identifier, a manufacturer could replace a square barcode with a rectangular one and keep the product’s original number.

This would avoid the need for a separate, shorter numbering format equivalent to GTIN-8, which exists partly to accommodate the space constraints of small packages.

Managing products and companies

Removing administrative information from the identifier would also require us to establish how the associated information should be managed.

Consider a manufacturer that produces bottles of shampoo in three different sizes. The registry would contain three separate records:

Product identifier Product Net content
0000000000000178 Shampoo 100 mL
0000000000000185 Shampoo 250 mL
0000000000000192 Shampoo 500 mL

Each identifier would refer to a particular trade item. Manufacturing a million identical bottles of the 250 mL shampoo would not require a million identifiers, since the purpose of the standard would be to distinguish commercially identifiable products rather than individual physical units.

Information about the company responsible for each product would be stored independently of its identifier.

For instance, a registry record could be represented as follows:

{
  "identifier": "5837192640587315",
  "status": "active",
  "product": {
    "name": "Example shampoo",
    "brand": "Example",
    "net_content": {
      "value": 250,
      "unit": "mL"
    }
  },
  "responsible_organisation": {
    "id": "org-10482"
  }
}

Because the registry would store the responsible organisation separately from the identifier, it could record a change of ownership and preserve that history if another company acquired the brand. A new identifier would only be required if the product itself changed in a way that required it to be distinguished commercially.

Determining which product changes require new identifiers is a problem that any product identification standard must address. The existing GTIN Management Standard already provides rules concerning changes in formulation, net content, brand, packaging quantity and other characteristics. A successor could build upon much of that work.

Access to the registry would also need to be governed carefully. Companies should be authenticated before requesting identifiers or modifying product information, while retailers and other authorised users should be able to retrieve the information necessary for their operations.

Even with those controls, a counterfeiter could copy a barcode from a legitimate product, so the same valid identifier could appear on genuine and counterfeit goods. Authenticating products and assigning serial numbers to individual units would therefore remain separate from identifying trade items.

Would a global registry become a bottleneck?

One of the benefits of the existing GTIN allocation system is that a manufacturer can assign numbers to new products independently, without requesting each individual identifier from GS1.

Under the proposed system, manufacturers would depend on the organisations operating the registry to coordinate the allocation of identifiers.

However, allocating identifiers for new product types is a considerably less frequent operation than scanning products at checkout. Even at an illustrative rate of 120 million new identifiers per year, the system would need to allocate an average of fewer than four identifiers per second.

Peak demand would be higher, particularly if manufacturers submitted large product catalogues in batches. Nevertheless, the allocation workload would be modest by modern database standards.

The underlying allocation mechanism could use a globally coordinated sequence or another method that guarantees uniqueness. Regional organisations could operate independently within dynamically allocated portions of the numbering space, provided that those allocations remained coordinated and did not overlap.

At checkout, retailers could continue to look up products in their own local databases, synchronising relevant information periodically as they already do with GTINs.

The main difficulty would consequently concern governance, institutional coordination and the reliability of the allocation infrastructure, as opposed to the raw computational capacity required to operate it.

How could the transition take place?

The widespread adoption of GTIN presents a substantial obstacle to the introduction of a competing standard.

Retailers, manufacturers, distributors, online marketplaces, customs authorities and regulatory agencies already use GTINs extensively. Many of their systems assume that a global product identifier contains no more than 14 digits.

Although existing 2D barcode scanners may be physically capable of reading the proposed identifiers, their software would need to recognise the new numbering format. Databases, APIs and electronic data interchange standards would also need to accommodate it.

A gradual transition could involve registering new identifiers for existing products while retaining their original GTINs as associated identifiers in the registry.

During that period, manufacturers could print both barcodes on their packaging. Retailers that had adopted the new standard could use the Data Matrix symbol, while other retailers could continue to scan conventional EAN or UPC barcodes.

An upgraded checkout would need to distinguish the two identifier namespaces and map both identifiers to the same record in its local product database. That way, if a scanner read both symbols in one scan, the checkout would use the new identifier and add the product to the basket once.

Once the relevant infrastructure had been updated, manufacturers could progressively discontinue the use of the older barcodes where their commercial and regulatory obligations permitted it.

GS1’s own transition towards 2D barcodes at retail points of sale demonstrates that the replacement of a widely deployed barcode format is already a substantial undertaking. Replacing the underlying product identifier would require an even greater degree of coordination.

To test the proposed system on a smaller scale, a retailer could begin with its own brand, where it controls both the packaging and the checkout system. For example, its catalogue team could request identifiers for a new range of products in one batch and use the resulting registry records to set them up for sale, while retaining GTINs for partners that need them. A pilot would have to show that registering and exchanging product records this way saves enough work to justify supporting both identifiers. A retailer mainly interested in scanning smaller barcodes could adopt GS1 DataMatrix and keep its existing product numbers.

Proposed specification

The principal characteristics of the proposed standard can be summarised as follows:

Parameter Proposed specification
Identifier length 16 decimal digits
Assignable portion 15 digits
Check digit One digit, calculated using the GTIN modulo-10 algorithm
Theoretical numbering capacity 1 quadrillion identifiers
Internal identifier structure None
Allocation Globally coordinated, with authenticated registration
Identifier reuse Prohibited
Primary barcode symbology Data Matrix ECC 200
Barcode payload Complete 16-digit identifier
Default matrix dimensions 14 × 14 modules
Nominal barcode footprint 10 × 10 mm, including quiet zone
Nominal module width 0.625 mm
Quiet zone At least one module on every side
Alternative geometries Smaller square and rectangular Data Matrix symbols
Human-readable identifier Mandatory
Default text arrangement Two lines of eight digits
Alternative text arrangements Four groups of four digits around the symbol, or text alongside rectangular symbols
Product metadata Maintained separately in an authoritative registry
Legacy identifiers Supported through explicit registry mappings

Before the standard could be deployed, its physical dimensions, printing tolerances, text legibility and scanning performance would need to be validated experimentally. Its allocation protocols, product lifecycle rules and institutional governance would likewise require more detailed specifications.

Conclusion

The original GTIN architecture addressed a problem that manufacturers and retailers faced in the 1970s: how to assign globally distinguishable product numbers that could be printed on packaging, read by inexpensive optical scanners and processed using limited computing infrastructure.

The allocation of numbering blocks to countries and companies was a reasonable response to those circumstances. It allowed manufacturers to assign product identifiers independently, at a time when coordinating individual allocations through an international network would have been considerably more difficult.

Today, the technological circumstances are different. We have the infrastructure necessary to coordinate identifier allocation internationally, maintain product registries and encode considerably more information within a small physical area.

A fixed-length, 16-digit numeric identifier would preserve GTIN’s most useful characteristics, particularly its compactness and suitability for manual transcription. At the same time, eliminating embedded administrative prefixes would allow numbering capacity to be distributed according to actual demand.

By adopting Data Matrix as the primary barcode symbology and allowing different physical configurations, the same identifier could be printed on everything from large household appliances to small cosmetic containers.

The greatest obstacle to introducing such a standard would probably be institutional and commercial, given the number of organisations and systems that already depend on GTIN. From a technical perspective, however, there is little reason why a product identification standard designed today would need to reproduce all the allocation and formatting decisions inherited from the original UPC and EAN systems.