TL;DR
- A GS1 Digital Link URI is a web address with a fixed grammar: a domain, a primary key such as
/01/with a 14-digit GTIN, optional key qualifiers in the path, and data attributes in the query string. - Its numbers are GS1 Application Identifiers (AIs), the same ones used in GS1-128 barcodes, so a URI converts to a traditional element string and back without losing GS1 data.
- The rules that trip people up: GTINs padded to 14 digits with a valid check digit, qualifiers in a fixed order (
22,10,21), attributes only after?, and symbols in values percent-encoded.
A GS1 Digital Link URI is an HTTPS address that carries GS1 identifiers in a standard structure, so a phone can open it and a scanner can extract the identifiers from it. The path holds the identity; the query string holds extra data and resolver instructions. For the vocabulary, see GS1 Digital Link basics; for what happens after a scan, the resolver guide.
GS1 Digital Link URI syntax at a glance
| Pattern | https://{domain}/{key AI}/{value}/{qualifier AI}/{value}?{attribute AI}={value} |
| Identity | In the path: exactly one primary key, then optional key qualifiers in a fixed order |
| Extra data | In the query string: data attributes such as expiry date 17 or net weight 310n |
| GTIN format | Always 14 digits, padded with leading zeros, ending in a valid check digit |
| Special characters | Percent-encoded: a / inside a batch number becomes %2F |
| Resolver instructions | linkType in the query string, such as linkType=gs1:pip or linkType=linkset |
What are the parts of a GS1 Digital Link URI?

A complete example:
https://id.example.com/01/09506000134352/22/2A/10/LOT42/21/1234?17=271231&3103=000750
| Part | In the example | Rule |
|---|---|---|
| Domain | id.example.com | Any domain, after https://. It decides which resolver answers a phone, but it is not part of the product's identity |
| Primary key | /01/09506000134352 | Exactly one per URI: an AI followed by its value |
| Key qualifiers | /22/2A/10/LOT42/21/1234 | Optional, in the path, in the order set for that key |
| Data attributes | ?17=271231&3103=000750 | Optional, as AI=value pairs joined by &, in any order |
Read from left to right: GTIN 09506000134352, consumer product variant 2A, batch LOT42, serial number 1234, expiry date 31 December 2027, net weight 0.750 kg.
Which primary keys can a GS1 Digital Link use?
The GTIN is the key on consumer products, but the syntax covers the other GS1 keys too:
| GS1 key | AI | Identifies | Key qualifiers |
|---|---|---|---|
| GTIN, Global Trade Item Number | 01 | A trade item, at any packaging level | 22, 10, 21 |
| SSCC, Serial Shipping Container Code | 00 | A logistic unit such as a pallet (18 digits) | None |
| GLN, Global Location Number | 414 | A physical location (13 digits) | 254 GLN extension component |
Asset keys such as the GRAI (8003) and the GIAI (8004) follow the same pattern.
How do key qualifiers work for a GTIN?
Key qualifiers narrow a GTIN from a product to a variant, a batch or a single unit. They go in the path, in this order:
| Order | AI | Qualifier | Format | Identifies |
|---|---|---|---|---|
| 1 | 22 | Consumer product variant (CPV) | Up to 20 characters | A variant within one GTIN |
| 2 | 10 | Batch or lot | Up to 20 characters | One production run |
| 3 | 21 | Serial number | Up to 20 characters | One unit |
Any of them can be left out, but the ones you use keep that order:
| Path | Valid? |
|---|---|
/01/09506000134352/10/LOT42/21/1234 | Yes |
/01/09506000134352/21/1234 | Yes: a serial number without a batch |
/01/09506000134352/21/1234/10/LOT42 | No: the serial number comes before the batch |
/01/09506000134352/17/271231 | No: the expiry date belongs in the query string |
A resolver uses the qualifiers to find its most specific entry, falling back to the product level.
Which data attributes go in the query string?
Data attributes describe the item without changing its identity:
| AI | Attribute | Format | Example |
|---|---|---|---|
17 | Expiry date | YYMMDD | 17=271231: 31 December 2027 |
15 | Best before date | YYMMDD | 15=270630: 30 June 2027 |
310n | Net weight in kg, n = decimal places | 6 digits | 3103=000750: 0.750 kg |
422 | Country of origin | 3-digit ISO 3166 numeric code | 422=380: Italy |
Each attribute appears once, in any order. A resolver passes the query string on unchanged when it redirects, so the destination page can read it.
How should a GTIN be written in a GS1 Digital Link?
Always as 14 digits. Shorter GTINs get leading zeros, which change neither the number nor its check digit:
| GTIN under the barcode | In the URI |
|---|---|
GTIN-12 (UPC-A): 614141123452 | /01/00614141123452 |
GTIN-13 (EAN-13): 9506000134352 | /01/09506000134352 |
The last digit is a check digit. For 9506000134352, multiply the twelve digits before it, from the right, by 3, 1, 3, 1 and so on, and add them up: 78. The check digit takes that to the next multiple of ten: 80 − 78 = 2.
Which characters need percent-encoding?
Letters, digits, -, . and _ go in as they are. Other symbols in batch, serial or CPV values are percent-encoded, so they can't be mistaken for the address structure:
| Character | Encoded as | Value | In the URI |
|---|---|---|---|
/ | %2F | AB/12 | /10/AB%2F12 |
% | %25 | 50%OFF | /10/50%25OFF |
& | %26 | A&B | /21/A%26B |
Values are case-sensitive, so LOT42 and lot42 are different batches, and spaces are not allowed.
What is the compressed form?
The standard also defines a compressed form for very small codes: everything after the domain is packed into a short string of letters, digits, - and _, unreadable by eye, which the resolver expands before validating. Use the uncompressed form unless symbol size leaves no choice: it is easier to check before printing, and a compressed code works only where every scanner and app in your chain can decompress it.
How do linkType and linksets fit into the URI?
linkType is not an identifier but an instruction to the resolver, written in the query string:
| URI | What the resolver returns |
|---|---|
https://id.example.com/01/09506000134352 | A redirect to the default link, usually the product page |
https://id.example.com/01/09506000134352?linkType=gs1:recallStatus | A redirect to the recall status link, if there is one |
https://id.example.com/01/09506000134352?linkType=linkset | The full list of links for that GTIN, in a machine-readable format |
Link types come from the GS1 Web Vocabulary, such as gs1:pip (product information page), gs1:instructions and gs1:allergenInfo. Language is not set in the URI: the resolver reads it from the phone's request.
How does a GS1 Digital Link relate to an element string?
They carry the same GS1 data in two syntaxes:
| Format | Example | Used in |
|---|---|---|
| Element string | (01)09506000134352(10)LOT42(17)271231 | GS1-128 barcodes and the text under GS1 symbols |
| GS1 Digital Link URI | https://id.example.com/01/09506000134352/10/LOT42?17=271231 | QR codes and Data Matrix symbols that phones can open |
In an element string, the parentheses appear only in the printed text, and a variable-length value such as a batch ends with a separator character when another AI follows; in the URI, the slashes, ? and & do that job. Converting a URI to an element string keeps every AI and value and drops the domain and resolver instructions, which is what a 2D-ready checkout does, without an internet connection. For the choice of symbol, see QR code vs Data Matrix.
How to build a valid GS1 Digital Link URI: seven steps
- Choose the domain. Start with
https://and a domain you control, such asid.yourbrand.com, so the codes stay yours whichever provider runs the resolver. - Pick the primary key. For a product, AI
01and its GTIN:/01/. - Write the GTIN as 14 digits. Pad with leading zeros and check the last digit:
9506000134352becomes09506000134352. - Add the key qualifiers you need, in order. CPV
/22/, batch/10/, serial number/21/. - Percent-encode the values. Keep letters, digits,
-,.and_, and encode the rest:AB/12becomesAB%2F12. - Add data attributes after
?. Write each asAI=value, joined by&:?17=271231&3103=000750. - Validate before printing. Convert the URI to an element string and check every value, open it in a browser, then scan the printed code on several phones and a 2D scanner. The troubleshooting guide lists the usual failures.
The result for a batch with an expiry date: https://id.yourbrand.com/01/09506000134352/10/AB%2F12?17=271231.
Where the Digital Link platform fits
Digital Link, the platform behind this site, writes these URIs for you. It validates each GTIN when a link is created, and adds batch or lot, serial number, expiry date, net weight, country of origin, packaging date or consumer product variant as variants of a link, each with its own set of links. Codes can be created in bulk from a CSV file, on your own subdomain or the included dlink.is one.
Create your first GS1 Digital Link QR code
Frequently asked questions
Does a GS1 Digital Link need a 14-digit GTIN?
Yes. A GTIN-8, GTIN-12 or GTIN-13 is padded with leading zeros to 14 digits, so 9506000134352 is written /01/09506000134352. The check digit stays the same and must be valid.
In what order do the key qualifiers go?
For a GTIN: consumer product variant 22, then batch or lot 10, then serial number 21. Any can be left out, but the ones you use keep that order.
Does the domain change the product's identity?
No. The domain decides which resolver answers a phone, but the identity is the primary key and its qualifiers. The same GTIN under two domains is the same product.
What is the difference between a GS1 Digital Link URI and an element string?
The same data in two formats. An element string, such as (01)09506000134352(10)LOT42, is the format of GS1-128 barcodes. A GS1 Digital Link URI writes it as a web address that phones can open.
Should I use the compressed form?
Only if the symbol is too small for the full address. A compressed code works only where every scanner and app can decompress it.





